/doc/twitter.html
HTML | 2026 lines | 1808 code | 218 blank | 0 comment | 0 complexity | 18efb984b94b1834ef5c0d1b27eb7127 MD5 | raw file
Possible License(s): Apache-2.0
Large files files are truncated, but you can click here to view the full file
- <!doctype html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
- <html><head><title>Python: module twitter</title>
- </head><body bgcolor="#f0f0f8">
- <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
- <tr bgcolor="#7799ee">
- <td valign=bottom> <br>
- <font color="#ffffff" face="helvetica, arial"> <br><big><big><strong>twitter</strong></big></big> (version 0.8)</font></td
- ><td align=right valign=bottom
- ><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="twitter.py">twitter.py</a></font></td></tr></table>
- <p><tt>A library that provides a Python interface to the Twitter API</tt></p>
- <p>
- <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
- <tr bgcolor="#aa55cc">
- <td colspan=3 valign=bottom> <br>
- <font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
-
- <tr><td bgcolor="#aa55cc"><tt> </tt></td><td> </td>
- <td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="StringIO.html">StringIO</a><br>
- <a href="base64.html">base64</a><br>
- <a href="calendar.html">calendar</a><br>
- <a href="datetime.html">datetime</a><br>
- <a href="gzip.html">gzip</a><br>
- </td><td width="25%" valign=top><a href="httplib.html">httplib</a><br>
- <a href="oauth2.html">oauth2</a><br>
- <a href="os.html">os</a><br>
- <a href="rfc822.html">rfc822</a><br>
- <a href="json.html">json</a><br>
- </td><td width="25%" valign=top><a href="sys.html">sys</a><br>
- <a href="tempfile.html">tempfile</a><br>
- <a href="textwrap.html">textwrap</a><br>
- <a href="time.html">time</a><br>
- <a href="urllib.html">urllib</a><br>
- </td><td width="25%" valign=top><a href="urllib2.html">urllib2</a><br>
- <a href="urlparse.html">urlparse</a><br>
- </td></tr></table></td></tr></table><p>
- <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
- <tr bgcolor="#ee77aa">
- <td colspan=3 valign=bottom> <br>
- <font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
-
- <tr><td bgcolor="#ee77aa"><tt> </tt></td><td> </td>
- <td width="100%"><dl>
- <dt><font face="helvetica, arial"><a href="__builtin__.html#object">__builtin__.object</a>
- </font></dt><dd>
- <dl>
- <dt><font face="helvetica, arial"><a href="twitter.html#Api">Api</a>
- </font></dt><dt><font face="helvetica, arial"><a href="twitter.html#DirectMessage">DirectMessage</a>
- </font></dt><dt><font face="helvetica, arial"><a href="twitter.html#Hashtag">Hashtag</a>
- </font></dt><dt><font face="helvetica, arial"><a href="twitter.html#List">List</a>
- </font></dt><dt><font face="helvetica, arial"><a href="twitter.html#Status">Status</a>
- </font></dt><dt><font face="helvetica, arial"><a href="twitter.html#Trend">Trend</a>
- </font></dt><dt><font face="helvetica, arial"><a href="twitter.html#Url">Url</a>
- </font></dt><dt><font face="helvetica, arial"><a href="twitter.html#User">User</a>
- </font></dt></dl>
- </dd>
- <dt><font face="helvetica, arial"><a href="exceptions.html#Exception">exceptions.Exception</a>(<a href="exceptions.html#BaseException">exceptions.BaseException</a>)
- </font></dt><dd>
- <dl>
- <dt><font face="helvetica, arial"><a href="twitter.html#TwitterError">TwitterError</a>
- </font></dt></dl>
- </dd>
- </dl>
- <p>
- <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
- <tr bgcolor="#ffc8d8">
- <td colspan=3 valign=bottom> <br>
- <font color="#000000" face="helvetica, arial"><a name="Api">class <strong>Api</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr>
-
- <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
- <td colspan=2><tt>A python interface into the Twitter API<br>
- <br>
- By default, the <a href="#Api">Api</a> caches results for 1 minute.<br>
- <br>
- Example usage:<br>
- <br>
- To create an instance of the twitter.<a href="#Api">Api</a> class, with no authentication:<br>
- <br>
- >>> import twitter<br>
- >>> api = twitter.<a href="#Api">Api</a>()<br>
- <br>
- To fetch the most recently posted public twitter status messages:<br>
- <br>
- >>> statuses = api.<a href="#Api-GetPublicTimeline">GetPublicTimeline</a>()<br>
- >>> print [s.user.name for s in statuses]<br>
- [u'DeWitt', u'Kesuke Miyagi', u'ev', u'Buzz Andersen', u'Biz Stone'] #...<br>
- <br>
- To fetch a single user's public status messages, where "user" is either<br>
- a Twitter "short name" or their user id.<br>
- <br>
- >>> statuses = api.<a href="#Api-GetUserTimeline">GetUserTimeline</a>(user)<br>
- >>> print [s.text for s in statuses]<br>
- <br>
- To use authentication, instantiate the twitter.<a href="#Api">Api</a> class with a<br>
- consumer key and secret; and the oAuth key and secret:<br>
- <br>
- >>> api = twitter.<a href="#Api">Api</a>(consumer_key='twitter consumer key',<br>
- consumer_secret='twitter consumer secret',<br>
- access_token_key='the_key_given',<br>
- access_token_secret='the_key_secret')<br>
- <br>
- To fetch your friends (after being authenticated):<br>
- <br>
- >>> users = api.<a href="#Api-GetFriends">GetFriends</a>()<br>
- >>> print [u.name for u in users]<br>
- <br>
- To post a twitter status message (after being authenticated):<br>
- <br>
- >>> status = api.<a href="#Api-PostUpdate">PostUpdate</a>('I love python-twitter!')<br>
- >>> print status.text<br>
- I love python-twitter!<br>
- <br>
- There are many other methods, including:<br>
- <br>
- >>> api.<a href="#Api-PostUpdates">PostUpdates</a>(status)<br>
- >>> api.<a href="#Api-PostDirectMessage">PostDirectMessage</a>(user, text)<br>
- >>> api.<a href="#Api-GetUser">GetUser</a>(user)<br>
- >>> api.<a href="#Api-GetReplies">GetReplies</a>()<br>
- >>> api.<a href="#Api-GetUserTimeline">GetUserTimeline</a>(user)<br>
- >>> api.<a href="#Api-GetStatus">GetStatus</a>(id)<br>
- >>> api.<a href="#Api-DestroyStatus">DestroyStatus</a>(id)<br>
- >>> api.<a href="#Api-GetFriendsTimeline">GetFriendsTimeline</a>(user)<br>
- >>> api.<a href="#Api-GetFriends">GetFriends</a>(user)<br>
- >>> api.<a href="#Api-GetFollowers">GetFollowers</a>()<br>
- >>> api.<a href="#Api-GetFeatured">GetFeatured</a>()<br>
- >>> api.<a href="#Api-GetDirectMessages">GetDirectMessages</a>()<br>
- >>> api.<a href="#Api-PostDirectMessage">PostDirectMessage</a>(user, text)<br>
- >>> api.<a href="#Api-DestroyDirectMessage">DestroyDirectMessage</a>(id)<br>
- >>> api.<a href="#Api-DestroyFriendship">DestroyFriendship</a>(user)<br>
- >>> api.<a href="#Api-CreateFriendship">CreateFriendship</a>(user)<br>
- >>> api.<a href="#Api-GetUserByEmail">GetUserByEmail</a>(email)<br>
- >>> api.<a href="#Api-VerifyCredentials">VerifyCredentials</a>()<br> </tt></td></tr>
- <tr><td> </td>
- <td width="100%">Methods defined here:<br>
- <dl><dt><a name="Api-ClearCredentials"><strong>ClearCredentials</strong></a>(self)</dt><dd><tt>Clear the any credentials for this instance</tt></dd></dl>
- <dl><dt><a name="Api-CreateFavorite"><strong>CreateFavorite</strong></a>(self, status)</dt><dd><tt>Favorites the status specified in the status parameter as the authenticating user.<br>
- Returns the favorite status when successful.<br>
- <br>
- The twitter.<a href="#Api">Api</a> instance must be authenticated.<br>
- <br>
- Args:<br>
- The twitter.<a href="#Status">Status</a> instance to mark as a favorite.<br>
- Returns:<br>
- A twitter.<a href="#Status">Status</a> instance representing the newly-marked favorite.</tt></dd></dl>
- <dl><dt><a name="Api-CreateFriendship"><strong>CreateFriendship</strong></a>(self, user)</dt><dd><tt>Befriends the user specified in the user parameter as the authenticating user.<br>
- <br>
- The twitter.<a href="#Api">Api</a> instance must be authenticated.<br>
- <br>
- Args:<br>
- The ID or screen name of the user to befriend.<br>
- Returns:<br>
- A twitter.<a href="#User">User</a> instance representing the befriended user.</tt></dd></dl>
- <dl><dt><a name="Api-CreateList"><strong>CreateList</strong></a>(self, user, name, mode<font color="#909090">=None</font>, description<font color="#909090">=None</font>)</dt><dd><tt>Creates a new list with the give name<br>
- <br>
- The twitter.<a href="#Api">Api</a> instance must be authenticated.<br>
- <br>
- Args:<br>
- user:<br>
- Twitter name to create the list for<br>
- name:<br>
- New name for the list<br>
- mode:<br>
- 'public' or 'private'.<br>
- Defaults to 'public'. [Optional]<br>
- description:<br>
- Description of the list. [Optional]<br>
- <br>
- Returns:<br>
- A twitter.<a href="#List">List</a> instance representing the new list</tt></dd></dl>
- <dl><dt><a name="Api-CreateSubscription"><strong>CreateSubscription</strong></a>(self, owner, list)</dt><dd><tt>Creates a subscription to a list by the authenticated user<br>
- <br>
- The twitter.<a href="#Api">Api</a> instance must be authenticated.<br>
- <br>
- Args:<br>
- owner:<br>
- <a href="#User">User</a> name or id of the owner of the list being subscribed to.<br>
- list:<br>
- The slug or list id to subscribe the user to<br>
- <br>
- Returns:<br>
- A twitter.<a href="#List">List</a> instance representing the list subscribed to</tt></dd></dl>
- <dl><dt><a name="Api-DestroyDirectMessage"><strong>DestroyDirectMessage</strong></a>(self, id)</dt><dd><tt>Destroys the direct message specified in the required ID parameter.<br>
- <br>
- The twitter.<a href="#Api">Api</a> instance must be authenticated, and the<br>
- authenticating user must be the recipient of the specified direct<br>
- message.<br>
- <br>
- Args:<br>
- id: The id of the direct message to be destroyed<br>
- <br>
- Returns:<br>
- A twitter.<a href="#DirectMessage">DirectMessage</a> instance representing the message destroyed</tt></dd></dl>
- <dl><dt><a name="Api-DestroyFavorite"><strong>DestroyFavorite</strong></a>(self, status)</dt><dd><tt>Un-favorites the status specified in the ID parameter as the authenticating user.<br>
- Returns the un-favorited status in the requested format when successful.<br>
- <br>
- The twitter.<a href="#Api">Api</a> instance must be authenticated.<br>
- <br>
- Args:<br>
- The twitter.<a href="#Status">Status</a> to unmark as a favorite.<br>
- Returns:<br>
- A twitter.<a href="#Status">Status</a> instance representing the newly-unmarked favorite.</tt></dd></dl>
- <dl><dt><a name="Api-DestroyFriendship"><strong>DestroyFriendship</strong></a>(self, user)</dt><dd><tt>Discontinues friendship with the user specified in the user parameter.<br>
- <br>
- The twitter.<a href="#Api">Api</a> instance must be authenticated.<br>
- <br>
- Args:<br>
- The ID or screen name of the user with whom to discontinue friendship.<br>
- Returns:<br>
- A twitter.<a href="#User">User</a> instance representing the discontinued friend.</tt></dd></dl>
- <dl><dt><a name="Api-DestroyList"><strong>DestroyList</strong></a>(self, user, id)</dt><dd><tt>Destroys the list from the given user<br>
- <br>
- The twitter.<a href="#Api">Api</a> instance must be authenticated.<br>
- <br>
- Args:<br>
- user:<br>
- The user to remove the list from.<br>
- id:<br>
- The slug or id of the list to remove.<br>
- Returns:<br>
- A twitter.<a href="#List">List</a> instance representing the removed list.</tt></dd></dl>
- <dl><dt><a name="Api-DestroyStatus"><strong>DestroyStatus</strong></a>(self, id)</dt><dd><tt>Destroys the status specified by the required ID parameter.<br>
- <br>
- The twitter.<a href="#Api">Api</a> instance must be authenticated and the<br>
- authenticating user must be the author of the specified status.<br>
- <br>
- Args:<br>
- id:<br>
- The numerical ID of the status you're trying to destroy.<br>
- <br>
- Returns:<br>
- A twitter.<a href="#Status">Status</a> instance representing the destroyed status message</tt></dd></dl>
- <dl><dt><a name="Api-DestroySubscription"><strong>DestroySubscription</strong></a>(self, owner, list)</dt><dd><tt>Destroys the subscription to a list for the authenticated user<br>
- <br>
- The twitter.<a href="#Api">Api</a> instance must be authenticated.<br>
- <br>
- Args:<br>
- owner:<br>
- The user id or screen name of the user that owns the<br>
- list that is to be unsubscribed from<br>
- list:<br>
- The slug or list id of the list to unsubscribe from<br>
- <br>
- Returns:<br>
- A twitter.<a href="#List">List</a> instance representing the removed list.</tt></dd></dl>
- <dl><dt><a name="Api-FilterPublicTimeline"><strong>FilterPublicTimeline</strong></a>(self, term, since_id<font color="#909090">=None</font>)</dt><dd><tt>Filter the public twitter timeline by a given search term on<br>
- the local machine.<br>
- <br>
- Args:<br>
- term:<br>
- term to search by.<br>
- since_id:<br>
- Returns results with an ID greater than (that is, more recent<br>
- than) the specified ID. There are limits to the number of<br>
- Tweets which can be accessed through the API. If the limit of<br>
- Tweets has occured since the since_id, the since_id will be<br>
- forced to the oldest ID available. [Optional]<br>
- <br>
- Returns:<br>
- A sequence of twitter.<a href="#Status">Status</a> instances, one for each message<br>
- containing the term</tt></dd></dl>
- <dl><dt><a name="Api-GetDirectMessages"><strong>GetDirectMessages</strong></a>(self, since<font color="#909090">=None</font>, since_id<font color="#909090">=None</font>, page<font color="#909090">=None</font>)</dt><dd><tt>Returns a list of the direct messages sent to the authenticating user.<br>
- <br>
- The twitter.<a href="#Api">Api</a> instance must be authenticated.<br>
- <br>
- Args:<br>
- since:<br>
- Narrows the returned results to just those statuses created<br>
- after the specified HTTP-formatted date. [Optional]<br>
- since_id:<br>
- Returns results with an ID greater than (that is, more recent<br>
- than) the specified ID. There are limits to the number of<br>
- Tweets which can be accessed through the API. If the limit of<br>
- Tweets has occured since the since_id, the since_id will be<br>
- forced to the oldest ID available. [Optional]<br>
- page:<br>
- Specifies the page of results to retrieve.<br>
- Note: there are pagination limits. [Optional]<br>
- <br>
- Returns:<br>
- A sequence of twitter.<a href="#DirectMessage">DirectMessage</a> instances</tt></dd></dl>
- <dl><dt><a name="Api-GetFavorites"><strong>GetFavorites</strong></a>(self, user<font color="#909090">=None</font>, page<font color="#909090">=None</font>)</dt><dd><tt>Return a list of <a href="#Status">Status</a> objects representing favorited tweets.<br>
- By default, returns the (up to) 20 most recent tweets for the<br>
- authenticated user.<br>
- <br>
- Args:<br>
- user:<br>
- The twitter name or id of the user whose favorites you are fetching.<br>
- If not specified, defaults to the authenticated user. [Optional]<br>
- page:<br>
- Specifies the page of results to retrieve.<br>
- Note: there are pagination limits. [Optional]</tt></dd></dl>
- <dl><dt><a name="Api-GetFeatured"><strong>GetFeatured</strong></a>(self)</dt><dd><tt>Fetch the sequence of twitter.<a href="#User">User</a> instances featured on twitter.com<br>
- <br>
- The twitter.<a href="#Api">Api</a> instance must be authenticated.<br>
- <br>
- Returns:<br>
- A sequence of twitter.<a href="#User">User</a> instances</tt></dd></dl>
- <dl><dt><a name="Api-GetFollowerIDs"><strong>GetFollowerIDs</strong></a>(self, userid<font color="#909090">=None</font>, cursor<font color="#909090">=-1</font>)</dt><dd><tt>Fetch the sequence of twitter.<a href="#User">User</a> instances, one for each follower<br>
- <br>
- The twitter.<a href="#Api">Api</a> instance must be authenticated.<br>
- <br>
- Returns:<br>
- A sequence of twitter.<a href="#User">User</a> instances, one for each follower</tt></dd></dl>
- <dl><dt><a name="Api-GetFollowers"><strong>GetFollowers</strong></a>(self, page<font color="#909090">=None</font>)</dt><dd><tt>Fetch the sequence of twitter.<a href="#User">User</a> instances, one for each follower<br>
- <br>
- The twitter.<a href="#Api">Api</a> instance must be authenticated.<br>
- <br>
- Args:<br>
- page:<br>
- Specifies the page of results to retrieve.<br>
- Note: there are pagination limits. [Optional]<br>
- <br>
- Returns:<br>
- A sequence of twitter.<a href="#User">User</a> instances, one for each follower</tt></dd></dl>
- <dl><dt><a name="Api-GetFriendIDs"><strong>GetFriendIDs</strong></a>(self, user<font color="#909090">=None</font>, cursor<font color="#909090">=-1</font>)</dt><dd><tt>Returns a list of twitter user id's for every person<br>
- the specified user is following.<br>
- <br>
- Args:<br>
- user:<br>
- The id or screen_name of the user to retrieve the id list for<br>
- [Optional]<br>
- <br>
- Returns:<br>
- A list of integers, one for each user id.</tt></dd></dl>
- <dl><dt><a name="Api-GetFriends"><strong>GetFriends</strong></a>(self, user<font color="#909090">=None</font>, cursor<font color="#909090">=-1</font>)</dt><dd><tt>Fetch the sequence of twitter.<a href="#User">User</a> instances, one for each friend.<br>
- <br>
- The twitter.<a href="#Api">Api</a> instance must be authenticated.<br>
- <br>
- Args:<br>
- user:<br>
- The twitter name or id of the user whose friends you are fetching.<br>
- If not specified, defaults to the authenticated user. [Optional]<br>
- <br>
- Returns:<br>
- A sequence of twitter.<a href="#User">User</a> instances, one for each friend</tt></dd></dl>
- <dl><dt><a name="Api-GetFriendsTimeline"><strong>GetFriendsTimeline</strong></a>(self, user<font color="#909090">=None</font>, count<font color="#909090">=None</font>, page<font color="#909090">=None</font>, since_id<font color="#909090">=None</font>, retweets<font color="#909090">=None</font>, include_entities<font color="#909090">=None</font>)</dt><dd><tt>Fetch the sequence of twitter.<a href="#Status">Status</a> messages for a user's friends<br>
- <br>
- The twitter.<a href="#Api">Api</a> instance must be authenticated if the user is private.<br>
- <br>
- Args:<br>
- user:<br>
- Specifies the ID or screen name of the user for whom to return<br>
- the friends_timeline. If not specified then the authenticated<br>
- user set in the twitter.<a href="#Api">Api</a> instance will be used. [Optional]<br>
- count:<br>
- Specifies the number of statuses to retrieve. May not be<br>
- greater than 100. [Optional]<br>
- page:<br>
- Specifies the page of results to retrieve.<br>
- Note: there are pagination limits. [Optional]<br>
- since_id:<br>
- Returns results with an ID greater than (that is, more recent<br>
- than) the specified ID. There are limits to the number of<br>
- Tweets which can be accessed through the API. If the limit of<br>
- Tweets has occured since the since_id, the since_id will be<br>
- forced to the oldest ID available. [Optional]<br>
- retweets:<br>
- If True, the timeline will contain native retweets. [Optional]<br>
- include_entities:<br>
- If True, each tweet will include a node called "entities,".<br>
- This node offers a variety of metadata about the tweet in a<br>
- discreet structure, including: user_mentions, urls, and<br>
- hashtags. [Optional]<br>
- <br>
- Returns:<br>
- A sequence of twitter.<a href="#Status">Status</a> instances, one for each message</tt></dd></dl>
- <dl><dt><a name="Api-GetLists"><strong>GetLists</strong></a>(self, user, cursor<font color="#909090">=-1</font>)</dt><dd><tt>Fetch the sequence of lists for a user.<br>
- <br>
- The twitter.<a href="#Api">Api</a> instance must be authenticated.<br>
- <br>
- Args:<br>
- user:<br>
- The twitter name or id of the user whose friends you are fetching.<br>
- If the passed in user is the same as the authenticated user<br>
- then you will also receive private list data.<br>
- cursor:<br>
- "page" value that Twitter will use to start building the<br>
- list sequence from. -1 to start at the beginning.<br>
- Twitter will return in the result the values for next_cursor<br>
- and previous_cursor. [Optional]<br>
- <br>
- Returns:<br>
- A sequence of twitter.<a href="#List">List</a> instances, one for each list</tt></dd></dl>
- <dl><dt><a name="Api-GetMentions"><strong>GetMentions</strong></a>(self, since_id<font color="#909090">=None</font>, max_id<font color="#909090">=None</font>, page<font color="#909090">=None</font>)</dt><dd><tt>Returns the 20 most recent mentions (status containing @twitterID)<br>
- for the authenticating user.<br>
- <br>
- Args:<br>
- since_id:<br>
- Returns results with an ID greater than (that is, more recent<br>
- than) the specified ID. There are limits to the number of<br>
- Tweets which can be accessed through the API. If the limit of<br>
- Tweets has occured since the since_id, the since_id will be<br>
- forced to the oldest ID available. [Optional]<br>
- max_id:<br>
- Returns only statuses with an ID less than<br>
- (that is, older than) the specified ID. [Optional]<br>
- page:<br>
- Specifies the page of results to retrieve.<br>
- Note: there are pagination limits. [Optional]<br>
- <br>
- Returns:<br>
- A sequence of twitter.<a href="#Status">Status</a> instances, one for each mention of the user.</tt></dd></dl>
- <dl><dt><a name="Api-GetPublicTimeline"><strong>GetPublicTimeline</strong></a>(self, since_id<font color="#909090">=None</font>, include_rts<font color="#909090">=None</font>, include_entities<font color="#909090">=None</font>)</dt><dd><tt>Fetch the sequence of public twitter.<a href="#Status">Status</a> message for all users.<br>
- <br>
- Args:<br>
- since_id:<br>
- Returns results with an ID greater than (that is, more recent<br>
- than) the specified ID. There are limits to the number of<br>
- Tweets which can be accessed through the API. If the limit of<br>
- Tweets has occured since the since_id, the since_id will be<br>
- forced to the oldest ID available. [Optional]<br>
- include_rts:<br>
- If True, the timeline will contain native retweets (if they<br>
- exist) in addition to the standard stream of tweets. [Optional]<br>
- include_entities:<br>
- If True, each tweet will include a node called "entities,".<br>
- This node offers a variety of metadata about the tweet in a<br>
- discreet structure, including: user_mentions, urls, and<br>
- hashtags. [Optional]<br>
- <br>
- Returns:<br>
- An sequence of twitter.<a href="#Status">Status</a> instances, one for each message</tt></dd></dl>
- <dl><dt><a name="Api-GetRateLimitStatus"><strong>GetRateLimitStatus</strong></a>(self)</dt><dd><tt>Fetch the rate limit status for the currently authorized user.<br>
- <br>
- Returns:<br>
- A dictionary containing the time the limit will reset (reset_time),<br>
- the number of remaining hits allowed before the reset (remaining_hits),<br>
- the number of hits allowed in a 60-minute period (hourly_limit), and<br>
- the time of the reset in seconds since The Epoch (reset_time_in_seconds).</tt></dd></dl>
- <dl><dt><a name="Api-GetReplies"><strong>GetReplies</strong></a>(self, since<font color="#909090">=None</font>, since_id<font color="#909090">=None</font>, page<font color="#909090">=None</font>)</dt><dd><tt>Get a sequence of status messages representing the 20 most<br>
- recent replies (status updates prefixed with @twitterID) to the<br>
- authenticating user.<br>
- <br>
- Args:<br>
- since_id:<br>
- Returns results with an ID greater than (that is, more recent<br>
- than) the specified ID. There are limits to the number of<br>
- Tweets which can be accessed through the API. If the limit of<br>
- Tweets has occured since the since_id, the since_id will be<br>
- forced to the oldest ID available. [Optional]<br>
- page:<br>
- Specifies the page of results to retrieve.<br>
- Note: there are pagination limits. [Optional]<br>
- since:<br>
- <br>
- Returns:<br>
- A sequence of twitter.<a href="#Status">Status</a> instances, one for each reply to the user.</tt></dd></dl>
- <dl><dt><a name="Api-GetRetweets"><strong>GetRetweets</strong></a>(self, statusid)</dt><dd><tt>Returns up to 100 of the first retweets of the tweet identified<br>
- by statusid<br>
- <br>
- Args:<br>
- statusid:<br>
- The ID of the tweet for which retweets should be searched for<br>
- <br>
- Returns:<br>
- A list of twitter.<a href="#Status">Status</a> instances, which are retweets of statusid</tt></dd></dl>
- <dl><dt><a name="Api-GetSearch"><strong>GetSearch</strong></a>(self, term, geocode<font color="#909090">=None</font>, since_id<font color="#909090">=None</font>, per_page<font color="#909090">=15</font>, page<font color="#909090">=1</font>, lang<font color="#909090">='en'</font>, show_user<font color="#909090">='true'</font>, query_users<font color="#909090">=False</font>)</dt><dd><tt>Return twitter search results for a given term.<br>
- <br>
- Args:<br>
- term:<br>
- term to search by.<br>
- since_id:<br>
- Returns results with an ID greater than (that is, more recent<br>
- than) the specified ID. There are limits to the number of<br>
- Tweets which can be accessed through the API. If the limit of<br>
- Tweets has occured since the since_id, the since_id will be<br>
- forced to the oldest ID available. [Optional]<br>
- geocode:<br>
- geolocation information in the form (latitude, longitude, radius)<br>
- [Optional]<br>
- per_page:<br>
- number of results to return. Default is 15 [Optional]<br>
- page:<br>
- Specifies the page of results to retrieve.<br>
- Note: there are pagination limits. [Optional]<br>
- lang:<br>
- language for results. Default is English [Optional]<br>
- show_user:<br>
- prefixes screen name in status<br>
- query_users:<br>
- If set to False, then all users only have screen_name and<br>
- profile_image_url available.<br>
- If set to True, all information of users are available,<br>
- but it uses lots of request quota, one per status.<br>
- <br>
- Returns:<br>
- A sequence of twitter.<a href="#Status">Status</a> instances, one for each message containing<br>
- the term</tt></dd></dl>
- <dl><dt><a name="Api-GetStatus"><strong>GetStatus</strong></a>(self, id)</dt><dd><tt>Returns a single status message.<br>
- <br>
- The twitter.<a href="#Api">Api</a> instance must be authenticated if the<br>
- status message is private.<br>
- <br>
- Args:<br>
- id:<br>
- The numeric ID of the status you are trying to retrieve.<br>
- <br>
- Returns:<br>
- A twitter.<a href="#Status">Status</a> instance representing that status message</tt></dd></dl>
- <dl><dt><a name="Api-GetSubscriptions"><strong>GetSubscriptions</strong></a>(self, user, cursor<font color="#909090">=-1</font>)</dt><dd><tt>Fetch the sequence of Lists that the given user is subscribed to<br>
- <br>
- The twitter.<a href="#Api">Api</a> instance must be authenticated.<br>
- <br>
- Args:<br>
- user:<br>
- The twitter name or id of the user<br>
- cursor:<br>
- "page" value that Twitter will use to start building the<br>
- list sequence from. -1 to start at the beginning.<br>
- Twitter will return in the result the values for next_cursor<br>
- and previous_cursor. [Optional]<br>
- <br>
- Returns:<br>
- A sequence of twitter.<a href="#List">List</a> instances, one for each list</tt></dd></dl>
- <dl><dt><a name="Api-GetTrendsCurrent"><strong>GetTrendsCurrent</strong></a>(self, exclude<font color="#909090">=None</font>)</dt><dd><tt>Get the current top trending topics<br>
- <br>
- Args:<br>
- exclude:<br>
- Appends the exclude parameter as a request parameter.<br>
- Currently only exclude=hashtags is supported. [Optional]<br>
- <br>
- Returns:<br>
- A list with 10 entries. Each entry contains the twitter.</tt></dd></dl>
- <dl><dt><a name="Api-GetTrendsDaily"><strong>GetTrendsDaily</strong></a>(self, exclude<font color="#909090">=None</font>, startdate<font color="#909090">=None</font>)</dt><dd><tt>Get the current top trending topics for each hour in a given day<br>
- <br>
- Args:<br>
- startdate:<br>
- The start date for the report.<br>
- Should be in the format YYYY-MM-DD. [Optional]<br>
- exclude:<br>
- Appends the exclude parameter as a request parameter.<br>
- Currently only exclude=hashtags is supported. [Optional]<br>
- <br>
- Returns:<br>
- A list with 24 entries. Each entry contains the twitter.<br>
- <a href="#Trend">Trend</a> elements that were trending at the corresponding hour of the day.</tt></dd></dl>
- <dl><dt><a name="Api-GetTrendsWeekly"><strong>GetTrendsWeekly</strong></a>(self, exclude<font color="#909090">=None</font>, startdate<font color="#909090">=None</font>)</dt><dd><tt>Get the top 30 trending topics for each day in a given week.<br>
- <br>
- Args:<br>
- startdate:<br>
- The start date for the report.<br>
- Should be in the format YYYY-MM-DD. [Optional]<br>
- exclude:<br>
- Appends the exclude parameter as a request parameter.<br>
- Currently only exclude=hashtags is supported. [Optional]<br>
- Returns:<br>
- A list with each entry contains the twitter.<br>
- <a href="#Trend">Trend</a> elements of trending topics for the corrsponding day of the week</tt></dd></dl>
- <dl><dt><a name="Api-GetUser"><strong>GetUser</strong></a>(self, user)</dt><dd><tt>Returns a single user.<br>
- <br>
- The twitter.<a href="#Api">Api</a> instance must be authenticated.<br>
- <br>
- Args:<br>
- user: The twitter name or id of the user to retrieve.<br>
- <br>
- Returns:<br>
- A twitter.<a href="#User">User</a> instance representing that user</tt></dd></dl>
- <dl><dt><a name="Api-GetUserByEmail"><strong>GetUserByEmail</strong></a>(self, email)</dt><dd><tt>Returns a single user by email address.<br>
- <br>
- Args:<br>
- email:<br>
- The email of the user to retrieve.<br>
- <br>
- Returns:<br>
- A twitter.<a href="#User">User</a> instance representing that user</tt></dd></dl>
- <dl><dt><a name="Api-GetUserRetweets"><strong>GetUserRetweets</strong></a>(self, count<font color="#909090">=None</font>, since_id<font color="#909090">=None</font>, max_id<font color="#909090">=None</font>, include_entities<font color="#909090">=False</font>)</dt><dd><tt>Fetch the sequence of retweets made by a single user.<br>
- <br>
- The twitter.<a href="#Api">Api</a> instance must be authenticated.<br>
- <br>
- Args:<br>
- count:<br>
- The number of status messages to retrieve. [Optional]<br>
- since_id:<br>
- Returns results with an ID greater than (that is, more recent<br>
- than) the specified ID. There are limits to the number of<br>
- Tweets which can be accessed through the API. If the limit of<br>
- Tweets has occured since the since_id, the since_id will be<br>
- forced to the oldest ID available. [Optional]<br>
- max_id:<br>
- Returns results with an ID less than (that is, older than) or<br>
- equal to the specified ID. [Optional]<br>
- include_entities:<br>
- If True, each tweet will include a node called "entities,".<br>
- This node offers a variety of metadata about the tweet in a<br>
- discreet structure, including: user_mentions, urls, and<br>
- hashtags. [Optional]<br>
- <br>
- Returns:<br>
- A sequence of twitter.<a href="#Status">Status</a> instances, one for each message up to count</tt></dd></dl>
- <dl><dt><a name="Api-GetUserTimeline"><strong>GetUserTimeline</strong></a>(self, id<font color="#909090">=None</font>, user_id<font color="#909090">=None</font>, screen_name<font color="#909090">=None</font>, since_id<font color="#909090">=None</font>, max_id<font color="#909090">=None</font>, count<font color="#909090">=None</font>, page<font color="#909090">=None</font>, include_rts<font color="#909090">=None</font>, include_entities<font color="#909090">=None</font>)</dt><dd><tt>Fetch the sequence of public <a href="#Status">Status</a> messages for a single user.<br>
- <br>
- The twitter.<a href="#Api">Api</a> instance must be authenticated if the user is private.<br>
- <br>
- Args:<br>
- id:<br>
- Specifies the ID or screen name of the user for whom to return<br>
- the user_timeline. [Optional]<br>
- user_id:<br>
- Specfies the ID of the user for whom to return the<br>
- user_timeline. Helpful for disambiguating when a valid user ID<br>
- is also a valid screen name. [Optional]<br>
- screen_name:<br>
- Specfies the screen name of the user for whom to return the<br>
- user_timeline. Helpful for disambiguating when a valid screen<br>
- name is also a user ID. [Optional]<br>
- since_id:<br>
- Returns results with an ID greater than (that is, more recent<br>
- than) the specified ID. There are limits to the number of<br>
- Tweets which can be accessed through the API. If the limit of<br>
- Tweets has occured since the since_id, the since_id will be<br>
- forced to the oldest ID available. [Optional]<br>
- max_id:<br>
- Returns only statuses with an ID less than (that is, older<br>
- than) or equal to the specified ID. [Optional]<br>
- count:<br>
- Specifies the number of statuses to retrieve. May not be<br>
- greater than 200. [Optional]<br>
- page:<br>
- Specifies the page of results to retrieve.<br>
- Note: there are pagination limits. [Optional]<br>
- include_rts:<br>
- If True, the timeline will contain …
Large files files are truncated, but you can click here to view the full file