desc
stringlengths
3
26.7k
decl
stringlengths
11
7.89k
bodies
stringlengths
8
553k
'A dict representation of this twitter.Status instance. The return value uses the same key names as the JSON representation. Return: A dict representing this twitter.Status instance'
def AsDict(self):
data = {} if self.created_at: data['created_at'] = self.created_at if self.favorited: data['favorited'] = self.favorited if self.favorite_count: data['favorite_count'] = self.favorite_count if self.id: data['id'] = self.id if self.text: data['text'] = self...
'Create a new instance based on a JSON dict. Args: data: A JSON dict, as converted from the JSON in the twitter API Returns: A twitter.Status instance'
@staticmethod def NewFromJsonDict(data):
if ('user' in data): user = User.NewFromJsonDict(data['user']) else: user = None if ('retweeted_status' in data): retweeted_status = Status.NewFromJsonDict(data['retweeted_status']) else: retweeted_status = None if ('current_user_retweet' in data): current_use...
'Get the unique id of this user. Returns: The unique id of this user'
def GetId(self):
return self._id
'Set the unique id of this user. Args: id: The unique id of this user.'
def SetId(self, id):
self._id = id
'Get the real name of this user. Returns: The real name of this user'
def GetName(self):
return self._name
'Set the real name of this user. Args: name: The real name of this user'
def SetName(self, name):
self._name = name
'Get the short twitter name of this user. Returns: The short twitter name of this user'
def GetScreenName(self):
return self._screen_name
'Set the short twitter name of this user. Args: screen_name: the short twitter name of this user'
def SetScreenName(self, screen_name):
self._screen_name = screen_name
'Get the geographic location of this user. Returns: The geographic location of this user'
def GetLocation(self):
return self._location
'Set the geographic location of this user. Args: location: The geographic location of this user'
def SetLocation(self, location):
self._location = location
'Get the short text description of this user. Returns: The short text description of this user'
def GetDescription(self):
return self._description
'Set the short text description of this user. Args: description: The short text description of this user'
def SetDescription(self, description):
self._description = description
'Get the homepage url of this user. Returns: The homepage url of this user'
def GetUrl(self):
return self._url
'Set the homepage url of this user. Args: url: The homepage url of this user'
def SetUrl(self, url):
self._url = url
'Get the url of the thumbnail of this user. Returns: The url of the thumbnail of this user'
def GetProfileImageUrl(self):
return self._profile_image_url
'Set the url of the thumbnail of this user. Args: profile_image_url: The url of the thumbnail of this user'
def SetProfileImageUrl(self, profile_image_url):
self._profile_image_url = profile_image_url
'Boolean for whether to tile the profile background image. Returns: True if the background is to be tiled, False if not, None if unset.'
def GetProfileBackgroundTile(self):
return self._profile_background_tile
'Set the boolean flag for whether to tile the profile background image. Args: profile_background_tile: Boolean flag for whether to tile or not.'
def SetProfileBackgroundTile(self, profile_background_tile):
self._profile_background_tile = profile_background_tile
'Returns the current time zone string for the user. Returns: The descriptive time zone string for the user.'
def GetTimeZone(self):
return self._time_zone
'Sets the user\'s time zone string. Args: time_zone: The descriptive time zone to assign for the user.'
def SetTimeZone(self, time_zone):
self._time_zone = time_zone
'Get the latest twitter.Status of this user. Returns: The latest twitter.Status of this user'
def GetStatus(self):
return self._status
'Set the latest twitter.Status of this user. Args: status: The latest twitter.Status of this user'
def SetStatus(self, status):
self._status = status
'Get the friend count for this user. Returns: The number of users this user has befriended.'
def GetFriendsCount(self):
return self._friends_count
'Set the friend count for this user. Args: count: The number of users this user has befriended.'
def SetFriendsCount(self, count):
self._friends_count = count
'Get the listed count for this user. Returns: The number of lists this user belongs to.'
def GetListedCount(self):
return self._listed_count
'Set the listed count for this user. Args: count: The number of lists this user belongs to.'
def SetListedCount(self, count):
self._listed_count = count
'Get the follower count for this user. Returns: The number of users following this user.'
def GetFollowersCount(self):
return self._followers_count
'Set the follower count for this user. Args: count: The number of users following this user.'
def SetFollowersCount(self, count):
self._followers_count = count
'Get the number of status updates for this user. Returns: The number of status updates for this user.'
def GetStatusesCount(self):
return self._statuses_count
'Set the status update count for this user. Args: count: The number of updates for this user.'
def SetStatusesCount(self, count):
self._statuses_count = count
'Get the number of favourites for this user. Returns: The number of favourites for this user.'
def GetFavouritesCount(self):
return self._favourites_count
'Set the favourite count for this user. Args: count: The number of favourites for this user.'
def SetFavouritesCount(self, count):
self._favourites_count = count
'Get the setting of geo_enabled for this user. Returns: True/False if Geo tagging is enabled'
def GetGeoEnabled(self):
return self._geo_enabled
'Set the latest twitter.geo_enabled of this user. Args: geo_enabled: True/False if Geo tagging is to be enabled'
def SetGeoEnabled(self, geo_enabled):
self._geo_enabled = geo_enabled
'Get the setting of verified for this user. Returns: True/False if user is a verified account'
def GetVerified(self):
return self._verified
'Set twitter.verified for this user. Args: verified: True/False if user is a verified account'
def SetVerified(self, verified):
self._verified = verified
'Get the setting of lang for this user. Returns: language code of the user'
def GetLang(self):
return self._lang
'Set twitter.lang for this user. Args: lang: language code for the user'
def SetLang(self, lang):
self._lang = lang
'Get the setting of notifications for this user. Returns: True/False for the notifications setting of the user'
def GetNotifications(self):
return self._notifications
'Set twitter.notifications for this user. Args: notifications: True/False notifications setting for the user'
def SetNotifications(self, notifications):
self._notifications = notifications
'Get the setting of contributors_enabled for this user. Returns: True/False contributors_enabled of the user'
def GetContributorsEnabled(self):
return self._contributors_enabled
'Set twitter.contributors_enabled for this user. Args: contributors_enabled: True/False contributors_enabled setting for the user'
def SetContributorsEnabled(self, contributors_enabled):
self._contributors_enabled = contributors_enabled
'Get the setting of created_at for this user. Returns: created_at value of the user'
def GetCreatedAt(self):
return self._created_at
'Set twitter.created_at for this user. Args: created_at: created_at value for the user'
def SetCreatedAt(self, created_at):
self._created_at = created_at
'A string representation of this twitter.User instance. The return value is the same as the JSON string representation. Returns: A string representation of this twitter.User instance.'
def __str__(self):
return self.AsJsonString()
'A JSON string representation of this twitter.User instance. Returns: A JSON string representation of this twitter.User instance'
def AsJsonString(self):
return simplejson.dumps(self.AsDict(), sort_keys=True)
'A dict representation of this twitter.User instance. The return value uses the same key names as the JSON representation. Return: A dict representing this twitter.User instance'
def AsDict(self):
data = {} if self.id: data['id'] = self.id if self.name: data['name'] = self.name if self.screen_name: data['screen_name'] = self.screen_name if self.location: data['location'] = self.location if self.description: data['description'] = self.description ...
'Create a new instance based on a JSON dict. Args: data: A JSON dict, as converted from the JSON in the twitter API Returns: A twitter.User instance'
@staticmethod def NewFromJsonDict(data):
if ('status' in data): status = Status.NewFromJsonDict(data['status']) else: status = None return User(id=data.get('id', None), name=data.get('name', None), screen_name=data.get('screen_name', None), location=data.get('location', None), description=data.get('description', None), statuses_cou...
'Get the unique id of this list. Returns: The unique id of this list'
def GetId(self):
return self._id
'Set the unique id of this list. Args: id: The unique id of this list.'
def SetId(self, id):
self._id = id
'Get the real name of this list. Returns: The real name of this list'
def GetName(self):
return self._name
'Set the real name of this list. Args: name: The real name of this list'
def SetName(self, name):
self._name = name
'Get the slug of this list. Returns: The slug of this list'
def GetSlug(self):
return self._slug
'Set the slug of this list. Args: slug: The slug of this list.'
def SetSlug(self, slug):
self._slug = slug
'Get the description of this list. Returns: The description of this list'
def GetDescription(self):
return self._description
'Set the description of this list. Args: description: The description of this list.'
def SetDescription(self, description):
self._description = description
'Get the full_name of this list. Returns: The full_name of this list'
def GetFull_name(self):
return self._full_name
'Set the full_name of this list. Args: full_name: The full_name of this list.'
def SetFull_name(self, full_name):
self._full_name = full_name
'Get the mode of this list. Returns: The mode of this list'
def GetMode(self):
return self._mode
'Set the mode of this list. Args: mode: The mode of this list.'
def SetMode(self, mode):
self._mode = mode
'Get the uri of this list. Returns: The uri of this list'
def GetUri(self):
return self._uri
'Set the uri of this list. Args: uri: The uri of this list.'
def SetUri(self, uri):
self._uri = uri
'Get the member_count of this list. Returns: The member_count of this list'
def GetMember_count(self):
return self._member_count
'Set the member_count of this list. Args: member_count: The member_count of this list.'
def SetMember_count(self, member_count):
self._member_count = member_count
'Get the subscriber_count of this list. Returns: The subscriber_count of this list'
def GetSubscriber_count(self):
return self._subscriber_count
'Set the subscriber_count of this list. Args: subscriber_count: The subscriber_count of this list.'
def SetSubscriber_count(self, subscriber_count):
self._subscriber_count = subscriber_count
'Get the following status of this list. Returns: The following status of this list'
def GetFollowing(self):
return self._following
'Set the following status of this list. Args: following: The following of this list.'
def SetFollowing(self, following):
self._following = following
'Get the user of this list. Returns: The owner of this list'
def GetUser(self):
return self._user
'Set the user of this list. Args: user: The owner of this list.'
def SetUser(self, user):
self._user = user
'A string representation of this twitter.List instance. The return value is the same as the JSON string representation. Returns: A string representation of this twitter.List instance.'
def __str__(self):
return self.AsJsonString()
'A JSON string representation of this twitter.List instance. Returns: A JSON string representation of this twitter.List instance'
def AsJsonString(self):
return simplejson.dumps(self.AsDict(), sort_keys=True)
'A dict representation of this twitter.List instance. The return value uses the same key names as the JSON representation. Return: A dict representing this twitter.List instance'
def AsDict(self):
data = {} if self.id: data['id'] = self.id if self.name: data['name'] = self.name if self.slug: data['slug'] = self.slug if self.description: data['description'] = self.description if self.full_name: data['full_name'] = self.full_name if self.mode: ...
'Create a new instance based on a JSON dict. Args: data: A JSON dict, as converted from the JSON in the twitter API Returns: A twitter.List instance'
@staticmethod def NewFromJsonDict(data):
if ('user' in data): user = User.NewFromJsonDict(data['user']) else: user = None return List(id=data.get('id', None), name=data.get('name', None), slug=data.get('slug', None), description=data.get('description', None), full_name=data.get('full_name', None), mode=data.get('mode', None), uri=d...
'An object to hold a Twitter direct message. This class is normally instantiated by the twitter.Api class and returned in a sequence. Note: Dates are posted in the form "Sat Jan 27 04:17:38 +0000 2007" Args: id: The unique id of this direct message. [Optional] created_at: The time this direct message was posted. [Optio...
def __init__(self, id=None, created_at=None, sender_id=None, sender_screen_name=None, recipient_id=None, recipient_screen_name=None, text=None):
self.id = id self.created_at = created_at self.sender_id = sender_id self.sender_screen_name = sender_screen_name self.recipient_id = recipient_id self.recipient_screen_name = recipient_screen_name self.text = text
'Get the unique id of this direct message. Returns: The unique id of this direct message'
def GetId(self):
return self._id
'Set the unique id of this direct message. Args: id: The unique id of this direct message'
def SetId(self, id):
self._id = id
'Get the time this direct message was posted. Returns: The time this direct message was posted'
def GetCreatedAt(self):
return self._created_at
'Set the time this direct message was posted. Args: created_at: The time this direct message was created'
def SetCreatedAt(self, created_at):
self._created_at = created_at
'Get the time this direct message was posted, in seconds since the epoch. Returns: The time this direct message was posted, in seconds since the epoch.'
def GetCreatedAtInSeconds(self):
return calendar.timegm(rfc822.parsedate(self.created_at))
'Get the unique sender id of this direct message. Returns: The unique sender id of this direct message'
def GetSenderId(self):
return self._sender_id
'Set the unique sender id of this direct message. Args: sender_id: The unique sender id of this direct message'
def SetSenderId(self, sender_id):
self._sender_id = sender_id
'Get the unique sender screen name of this direct message. Returns: The unique sender screen name of this direct message'
def GetSenderScreenName(self):
return self._sender_screen_name
'Set the unique sender screen name of this direct message. Args: sender_screen_name: The unique sender screen name of this direct message'
def SetSenderScreenName(self, sender_screen_name):
self._sender_screen_name = sender_screen_name
'Get the unique recipient id of this direct message. Returns: The unique recipient id of this direct message'
def GetRecipientId(self):
return self._recipient_id
'Set the unique recipient id of this direct message. Args: recipient_id: The unique recipient id of this direct message'
def SetRecipientId(self, recipient_id):
self._recipient_id = recipient_id
'Get the unique recipient screen name of this direct message. Returns: The unique recipient screen name of this direct message'
def GetRecipientScreenName(self):
return self._recipient_screen_name
'Set the unique recipient screen name of this direct message. Args: recipient_screen_name: The unique recipient screen name of this direct message'
def SetRecipientScreenName(self, recipient_screen_name):
self._recipient_screen_name = recipient_screen_name
'Get the text of this direct message. Returns: The text of this direct message.'
def GetText(self):
return self._text
'Set the text of this direct message. Args: text: The text of this direct message'
def SetText(self, text):
self._text = text
'A string representation of this twitter.DirectMessage instance. The return value is the same as the JSON string representation. Returns: A string representation of this twitter.DirectMessage instance.'
def __str__(self):
return self.AsJsonString()
'A JSON string representation of this twitter.DirectMessage instance. Returns: A JSON string representation of this twitter.DirectMessage instance'
def AsJsonString(self):
return simplejson.dumps(self.AsDict(), sort_keys=True)
'A dict representation of this twitter.DirectMessage instance. The return value uses the same key names as the JSON representation. Return: A dict representing this twitter.DirectMessage instance'
def AsDict(self):
data = {} if self.id: data['id'] = self.id if self.created_at: data['created_at'] = self.created_at if self.sender_id: data['sender_id'] = self.sender_id if self.sender_screen_name: data['sender_screen_name'] = self.sender_screen_name if self.recipient_id: ...
'Create a new instance based on a JSON dict. Args: data: A JSON dict, as converted from the JSON in the twitter API Returns: A twitter.DirectMessage instance'
@staticmethod def NewFromJsonDict(data):
return DirectMessage(created_at=data.get('created_at', None), recipient_id=data.get('recipient_id', None), sender_id=data.get('sender_id', None), text=data.get('text', None), sender_screen_name=data.get('sender_screen_name', None), id=data.get('id', None), recipient_screen_name=data.get('recipient_screen_name', Non...
'Create a new instance based on a JSON dict. Args: data: A JSON dict, as converted from the JSON in the twitter API Returns: A twitter.Hashtag instance'
@staticmethod def NewFromJsonDict(data):
return Hashtag(text=data.get('text', None))
'Create a new instance based on a JSON dict Args: data: A JSON dict timestamp: Gets set as the timestamp property of the new object Returns: A twitter.Trend object'
@staticmethod def NewFromJsonDict(data, timestamp=None):
return Trend(name=data.get('name', None), query=data.get('query', None), url=data.get('url', None), timestamp=timestamp)
'Create a new instance based on a JSON dict. Args: data: A JSON dict, as converted from the JSON in the twitter API Returns: A twitter.Url instance'
@staticmethod def NewFromJsonDict(data):
return Url(url=data.get('url', None), expanded_url=data.get('expanded_url', None))
'Instantiate a new twitter.Api object. Args: consumer_key: Your Twitter user\'s consumer_key. consumer_secret: Your Twitter user\'s consumer_secret. access_token_key: The oAuth access token key value you retrieved from running get_access_token.py. access_token_secret: The oAuth access token\'s secret, also retrieved fr...
def __init__(self, consumer_key=None, consumer_secret=None, access_token_key=None, access_token_secret=None, input_encoding=None, request_headers=None, cache=DEFAULT_CACHE, shortner=None, base_url=None, use_gzip_compression=False, debugHTTP=False):
self.SetCache(cache) self._urllib = urllib2 self._cache_timeout = Api.DEFAULT_CACHE_TIMEOUT self._input_encoding = input_encoding self._use_gzip = use_gzip_compression self._debugHTTP = debugHTTP self._oauth_consumer = None self._shortlink_size = 19 self._InitializeRequestHeaders(req...
'Set the consumer_key and consumer_secret for this instance Args: consumer_key: The consumer_key of the twitter account. consumer_secret: The consumer_secret for the twitter account. access_token_key: The oAuth access token key value you retrieved from running get_access_token.py. access_token_secret: The oAuth access ...
def SetCredentials(self, consumer_key, consumer_secret, access_token_key=None, access_token_secret=None):
self._consumer_key = consumer_key self._consumer_secret = consumer_secret self._access_token_key = access_token_key self._access_token_secret = access_token_secret self._oauth_consumer = None if ((consumer_key is not None) and (consumer_secret is not None) and (access_token_key is not None) and ...
'Clear the any credentials for this instance'
def ClearCredentials(self):
self._consumer_key = None self._consumer_secret = None self._access_token_key = None self._access_token_secret = None self._oauth_consumer = None