class Query(Twython): (source)
Constructor: Query(app_key, app_secret, oauth_token, oauth_token_secret)
Retrieve data from the Twitter REST API.
| Method | __init__ |
Undocumented |
| Method | expand |
Given a file object containing a list of Tweet IDs, fetch the corresponding full Tweets from the Twitter API. |
| Method | register |
Register a method for handling Tweets. |
| Method | search |
Call the REST API 'search/tweets' endpoint with some plausible defaults. See the Twitter search documentation for more information about admissible search parameters. |
| Method | user |
Convert a list of userIDs into a variety of information about the users. |
| Method | user |
Return a collection of the most recent Tweets posted by the user |
| Instance Variable | do |
Undocumented |
| Instance Variable | handler |
Undocumented |
| Method | _search |
Assumes that the handler has been informed. Fetches Tweets from search_tweets generator output and passses them to handler |
Given a file object containing a list of Tweet IDs, fetch the corresponding full Tweets from the Twitter API.
The API call statuses/lookup will fail to retrieve a Tweet if the
user has deleted it.
This call to the Twitter API is rate-limited. See <https://dev.twitter.com/rest/reference/get/statuses/lookup> for details.
| Parameters | |
| ids | input file object consisting of Tweet IDs, one to a line |
| verbose | Undocumented |
| Returns | |
| iterable of Tweet objects in JSON format | |
Register a method for handling Tweets.
| Parameters | |
| handler | Undocumented |
| method for viewing or writing Tweets to a file. | |
Call the REST API 'search/tweets' endpoint with some plausible defaults. See the Twitter search documentation for more information about admissible search parameters.
| Parameters | |
| keywords | Undocumented |
| limit | Undocumented |
| lang | Undocumented |
| max | Undocumented |
| retries | Undocumented |
| str keywords | A list of query terms to search for, written as a comma-separated string |
| int limit | Number of Tweets to process |
| str lang | language |
| int max | id of the last tweet fetched |
| int retries | number of retries when searching Tweets before raising an exception |
| Returns | |
| python generator | Undocumented |
Convert a list of userIDs into a variety of information about the users.
See <https://dev.twitter.com/rest/reference/get/users/show>.
| Parameters | |
| userids | Undocumented |
| list userids | A list of integer strings corresponding to Twitter userIDs |
| Returns | |
| list(json) | Undocumented |
Return a collection of the most recent Tweets posted by the user
| Parameters | |
| screen | Undocumented |
| limit | Undocumented |
| include | Undocumented |
| str user | The user's screen name; the initial '@' symbol should be omitted |
| int limit | The number of Tweets to recover; 200 is the maximum allowed |
| str include | Whether to include statuses which have been retweeted by the user; possible values are 'true' and 'false' |
Assumes that the handler has been informed. Fetches Tweets from search_tweets generator output and passses them to handler
| Parameters | |
| keywords | Undocumented |
| limit | Undocumented |
| lang | Undocumented |
| str keywords | A list of query terms to search for, written as a comma-separated string. |
| int limit | Number of Tweets to process |
| str lang | language |