Exemplo n.º 1
0
	The user ID of the user who owns the list being requested by a slug.'''
    def __init__(self):
        super().__init__()
        self._method = post

    def __call__(self,
                 list_id=None,
                 slug=None,
                 user_id=None,
                 screen_name=None,
                 owner_screen_name=None,
                 owner_id=None):
        return super().__call__(**filter(**vars()))

    def __repr__(self):
        return '''PARAMETERS
 list_id           -> int
 slug              -> string
 user_id           -> int
 screen_name       -> string
 owner_screen_name -> string
 owner_id          -> int'''


# encapsulate namespace
members = AbstractModule(globals())

# enforce singleton
del (destroy, create_all, show, create, destroy_all, Ternary, AbstractModule,
     post, get)
Exemplo n.º 2
0
try:
    from twitter.application.api.superclass.abstract_module import AbstractModule
    from twitter.application.api._mutes.users import users
except ModuleNotFoundError as main:
    from application.api.superclass.abstract_module import AbstractModule
    from application.api._mutes.users import users

# encapsulate namespace
mutes = AbstractModule(globals())
setattr(mutes, 'users', users)

# enforce singleton
del (users, AbstractModule)
Exemplo n.º 3
0
	- lat
	If provided with a long parameter the available trend locations will be 
    sorted by distance, nearest to furthest, to the co-ordinate pair. The valid 
    ranges for longitude is -180.0 to +180.0 (West is negative, East is 
    positive) inclusive. 

	- long
	If provided with a lat parameter the available trend locations will be 
    sorted by distance, nearest to furthest, to the co-ordinate pair. The valid 
    ranges for longitude is -180.0 to +180.0 (West is negative, East is 
    positive) inclusive.'''
    def __init__(self):
        super().__init__()
        self._method = get

    def __call__(self, lat=None, long=None):
        return super().__call__(**filter(**vars()))

    def __repr__(self):
        return '''PARAMETERS
 lat  -> -90 <= int <= 90
 long -> -180 <= int <= 180'''


# encapsulate namespace
trends = AbstractModule(globals())

# enforce singleton
del (place, available, closest, AbstractBase, AbstractModule, Empty, get)
Exemplo n.º 4
0
    - image
    The base64-encoded file content being uploaded. 

    - additional_owners
    A comma-separated list of user IDs to set as additional owners allowed to 
    use the returned media_id in Tweets or Cards. Up to 100 additional owners 
    may be specified.'''
    def __init__(self):
        super().__init__()

    def __call__(self, image=None, additional_owners=None):
        self._data = {'media_data': base64encode({'image': image})['image']}
        del image
        return super().__call__(**filter(**vars()))

    def __repr__(self):
        return '''PARAMETERS
 image             -> abspath to jpg, gif, or png
 additional_owners -> comma separated list of user ids'''


# encapsulate namespace
media = AbstractModule(globals())

# TODO
###### setattr(media, 'multipart', multipart)

# enforce singleton
del (upload, Media, AbstractBase, AbstractModule, get, post)
Exemplo n.º 5
0
                 long=None,
                 query=None,
                 ip=None,
                 granularity=None,
                 accuracy=None,
                 max_results=None,
                 contained_within=None,
                 street_address=None,
                 callback=None):
        return super().__call__(**filter(**vars()))

    def __repr__(self):
        return '''PARAMETERS
 lat              -> -90 <= float <= 90
 long             -> -180 <= float <= 180
 query            -> string, name
 ip               -> ip address
 granularity      -> str in {'poi', 'neighborhood', 'city', 'admin', 'country'}
 accuracy         -> int, or a numeric string postfixed with 'ft'
 max_results      -> int
 contained_within -> place_id string
 street_address   -> string
 callback         -> string'''


# encapsulate namespace
geo = AbstractModule(globals())

# enforce singleton
del (id, reverse_geocode, search, AbstractBase, AbstractModule, Numeric, get)
Exemplo n.º 6
0
authenticating user must be the recipient of the specified direct message. 
Direct Messages are only removed from the interface of the user context 
provided. Other members of the conversation can still access the Direct 
Messages. A successful delete will return a 204 http response code with no body 
content.

Important: This method requires an access token with RWD (read, write & direct 
message) permissions.

    - id 
    The id of the Direct Message event that should be deleted.'''

    def __init__(self):
        super().__init__()
        self._method = delete

    def __call__(self, id=None):
        return super().__call__(**filter(**vars(
            )))

    def __repr__(self):
        return '''PARAMETERS
 id -> int; msg id'''

# encapsulate namespace
events = AbstractModule(globals())

# enforce singleton
del (show, new, List, destroy,
     AbstractModule, Ternary, get, post, delete)
Exemplo n.º 7
0
    - recipient_id
    The user ID of the user to receive the typing indicator.'''
    def __init__(self):
        super().__init__()
        self._method = post

    def __call__(self, recipient_id=None):
        super().__call__(**filter(**vars()))

    def __repr__(self):
        return '''PARAMETERS
 recipient_id -> int; user id'''


# encapsulate namespace
direct_messages = AbstractModule(globals())
#setattr(direct_messages, 'welcome_messages', welcome_messages)
setattr(direct_messages, 'events', events)

# enforce singleton
del (
    mark_read,
    indicate_typing,
    events,  #welcome_messages,
    AbstractBase,
    AbstractModule,
    get,
    post,
    delete)
Exemplo n.º 8
0
    def __repr__(self):
        return '''PARAMETERS
 query -> len(string) <= 100'''


class destroy(Numeric):
    '''Destroys a saved search for the authenticating user. The authenticating 
user must be the owner of saved search id being destroyed. 

	- id
	The ID of the saved search.'''
    def __init__(self):
        super().__init__()
        self._method = post

    def __call__(self, id=None):
        return super().__call__(**filter(**vars()))

    def __repr__(self):
        return '''PARAMETERS
 id -> int'''


# encapsulate namespace
saved_searches = AbstractModule(globals())

# enforce singleton
del (List, create, destroy, show, Numeric, Empty, AbstractBase, AbstractModule,
     post, get)
Exemplo n.º 9
0
    with height, width, and offset_left to select the desired region of the 
    image to use.'''

    def __init__(self):
        super().__init__()
        self._key = 'banner'

    def __call__(self, banner=None, width=None, height=None, offset_left=None,
            offset_top=None):
        return super().__call__(**filter(**vars(
            )))

    def __repr__(self):
        return ''' PARAMETERS
 banner      -> image file abspath/location
 width       -> pos int; width of preferred section of the img, in pixels
 height      -> height of the preferred section.
 offset_left -> num of px by which to offset the image from the left
 offset_top  -> num px to offset the uploaded image from the top.'''

# encapsulate namespace
account = AbstractModule(globals())

# enforce singleton
del (settings, verify_credentials, update_settings,
     update_profile, update_profile_image, remove_profile_banner,
     update_profile_banner,
     
     AbstractBase, AbstractModule, Empty, 
     Base64, get, post)
Exemplo n.º 10
0
class remove(Ternary):
    '''Remove the specified Tweet from a Collection.

Use POST collections / entries / curate to remove Tweets from a Collection in 
bulk.

    - id
    The identifier of the target Collection.

    - tweet_id
    The identifier of the Tweet to remove.'''
    def __init__(self):
        super().__init__()
        self._method = post

    def __call__(self, id=None, tweet_id=None):
        return super().__call__(**filter(**vars()))

    def __repr__(self):
        return '''PARAMETERS
 id       -> string
 tweet_id -> int'''


# encapsulate namespace
entries = AbstractModule(globals())

# enforce singleton
del (add, curate, move, remove, AbstractModule, Ternary, delete, post, get)
Exemplo n.º 11
0
        self._method = get

    def __call__(self, resources=None):

        if self.twitter.CACHE_LOCKED: 
            # caching is off or we are updating the cache
            return super().__call__()

        elif not bool(self.twitter.cache) or self.twitter.cache.expired:
            # the cache does not exist or the cache is expired
            # create a new cache
            try:
                self.twitter.cache.refresh(self)
            except CacheError as a_problem:
                self.twitter.log.debug(a_problem)
        
        try:
            return self.twitter.cache[resources]
        except KeyError as update:
            return self.twitter.cache

    def __repr__(self):
        return ''' PARAMETERS
 resources -> a comma-seperated list of resource families'''

# encapsulate namespace
application = AbstractModule(globals())

# enforce singleton
del rate_limit_status, AbstractBase, AbstractModule, get
Exemplo n.º 12
0
Returns the liked status when successful. 

This process invoked by this method is asynchronous. The immediately returned 
status may not indicate the resultant liked status of the tweet. A 200 OK 
response from this method will indicate whether the intended action was 
successful or not. 

	- id
	The numerical ID of the desired status. 

	- include_entities
	The entities node will be omitted when set to false.'''
    def __init__(self):
        super().__init__()
        self._method = post

    def __call__(self, id=None, include_entities=False):
        return super().__call__(**filter(**vars()))

    def __repr__(self):
        return '''PARAMETERS
 id               -> int; status id
 include_entities -> bool'''


# encapsulate namespace
favorites = AbstractModule(globals())

# enforce singleton
del (List, destroy, create, AbstractBase, AbstractModule, post, get)
Exemplo n.º 13
0
    - name
    The title of the Collection being created, in 25 characters or fewer.

    - description
    A brief description of this Collection in 160 characters or fewer.

    - url
    A fully-qualified URL to associate with this Collection.'''
    def __init__(self):
        super().__init__()
        self._method = post

    def __call__(self, id=None, name=None, description=None, url=None):
        return super().__call__(**filter(**vars()))

    def __repr__(self):
        return '''PARAMETERS
 id          -> string
 name        -> string
 description -> string
 url         -> string'''


# encapsulate
collections = AbstractModule(globals())
setattr(collections, 'entries', entries)

# enforce singleton
del (entries, List, show, create, destroy, entries_endpoint, AbstractBase,
     AbstractModule, Collision, post, get)
Exemplo n.º 14
0
	- include_user_entities
	The user object entities node will not be included when set to false.'''
    def __init__(self):
        super().__init__()
        self._method = get

    def __call__(self,
                 user_id=None,
                 screen_name=None,
                 cursor=None,
                 count=20,
                 skip_status=False,
                 include_user_entities=False):
        return super().__call__(**filter(**vars()))

    def __repr__(self):
        return '''PARAMETERS
 user_id               -> int
 screen_name           -> string
 cursor                -> string
 count                 -> int
 skip_status           -> bool
 include_user_entities -> bool'''


# encapsulate namespace
followers = AbstractModule(globals())

# enforce singleton
del (ids, List, AbstractBase, AbstractModule, get)
Exemplo n.º 15
0
	- map
	When using the map parameter, tweets that do not exist or cannot be viewed 
    by the current user will still have their key represented but with an 
    explicitly null value paired with it'''
    def __init__(self):
        super().__init__()
        self._method = get

    def __call__(self,
                 id=None,
                 include_entities=False,
                 trim_user=False,
                 map=False):
        return super().__call__(**filter(**vars()))

    def __repr__(self):
        return ''' 
	id -> csv list of tweet IDs; max 100 entries 
	include_entities -> bool
	trim_user -> true, t or 1  
	map -> bool'''


# encapsulate namespace
statuses = AbstractModule(globals())

# enforce singleton
del (mentions_timeline, user_timeline, home_timeline, retweets_of_me, retweets,
     show, destroy, update, retweet, unretweet, oembed, retweeters, lookup,
     AbstractBase, AbstractModule, Numeric, get, post)
Exemplo n.º 16
0
    Provide values as returned in the response body’s next_cursor and 
    previous_cursor attributes to page back and forth in the list. It is 
    recommended to always use cursors when the method supports them. See 
    [node:10362] for more information.'''

    def __init__(self):
        super().__init__()
        self._method = get 

    def __call__(self, user_id=None, screen_name=None, count=20, cursor=None):
        return super().__call__(**filter(**vars(
            )))

    def __repr__(self):
        return '''PARAMETERS
 user_id     -> int
 screen_name -> string
 count       -> int <= 1000
 cursor      -> string'''

# encapsulate namespace
lists = AbstractModule(globals())
setattr(lists, 'members', members)
setattr(lists, 'subscribers', subscribers)

# enforce singleton
del (List, statuses, memberships, subscribers_endpoint, members_endpoint, destroy, update, create,
     show, subscriptions, ownerships, members, subscribers,
     
     AbstractBase, AbstractModule, Collision, post, get)
Exemplo n.º 17
0
connections can be: following, following_requested, followed_by, none, blocking, 
muting. 

	- screen_name
	A comma separated list of screen names, up to 100 are allowed in a single 
    request. 

	- user_id
	A comma separated list of user IDs, up to 100 are allowed in a single 
    request.'''

    def __init__(self):
        super().__init__()
        self._method = get

    def __call__(self, screen_name=None, user_id=None):
        return super().__call__(**filter(**vars(
            )))

    def __repr__(self):
        return '''PARAMETERS
 screen_name -> string
 user_id     -> int'''
       
# encapsulate namespace
friendships = AbstractModule(globals())

# enforce singleton
del (no_retweets, incoming, outgoing, create, destroy, update, show, lookup,
     AbstractBase, AbstractModule, post, get)
Exemplo n.º 18
0
        self._url = url
        return response

    def __repr__(self):
        return '''PARAMETERS
 slug -> string
 lang -> two letter ISO 639-1 specification'''

class members(slug):
    '''Access the users in a given category of the Twitter suggested user list 
and return their most recent status if they are not a protected user. 

	- slug
	The short name of list or a category'''

    def __init__(self):
        super().__init__()
        self._method = get
        self._url = self.url.replace('.json', '/members.json')
        self._endpoint += '/members'

    def __call__(self, slug=None):
        return super().__call__(**filter(**vars(
            )))

    def __repr__(self):
        return '''PARAMETERS
 slug -> string'''

suggestions = AbstractModule(globals())
Exemplo n.º 19
0
	- owner_screen_name
	The screen name of the user who owns the list being requested by a slug. 

	- owner_id
	The user ID of the user who owns the list being requested by a slug.'''
    def __init__(self):
        super().__init__()
        self._method = post

    def __call__(self,
                 list_id=None,
                 slug=None,
                 owner_screen_name=None,
                 owner_id=None):
        return super().__call__(**filter(**vars()))

    def __repr__(self):
        return '''PARAMETERS
 list_id           -> int
 slug              -> string
 owner_screen_name -> string
 owner_id          -> int'''


# encapsulate namespace
subscribers = AbstractModule(globals())

# enforce singleton
del (create, destroy, show, Ternary, AbstractModule, post, get)
Exemplo n.º 20
0
	The entities node will not be included when set to false. 

    - skip_status
	When set to either true, t or 1 statuses will not be included in the 
    returned user objects.'''
    def __init__(self):
        super().__init__()
        self._method = post

    def __call__(self,
                 screen_name=None,
                 user_id=None,
                 include_entities=True,
                 skip_status=False):
        super().__call__(**filter(**vars()))

    def __repr__(self):
        return '''PARAMETERS
 screen_name      -> string
 user_id          -> int; twitter user id
 include_entities -> bool
 skip_status      -> bool'''


# encapsulate namespace
blocks = AbstractModule(globals())

# enforce singleton

del (List, ids, create, destroy, AbstractBase, AbstractModule, get, post)