nltk.twitter.TweetViewer¶
- class nltk.twitter.TweetViewer[source]¶
Bases:
TweetHandlerI
Handle data by sending it to the terminal.
- handle(data)[source]¶
Direct data to sys.stdout
- Returns
return
False
if processing should cease, otherwise returnTrue
.- Return type
bool
- Parameters
data – Tweet object returned by Twitter API
- __init__(limit=20, upper_date_limit=None, lower_date_limit=None)[source]¶
- Parameters
limit (int) – The number of data items to process in the current round of processing.
upper_date_limit (tuple) – The date at which to stop collecting new data. This should be entered as a tuple which can serve as the argument to datetime.datetime. E.g. date_limit=(2015, 4, 1, 12, 40) for 12:30 pm on April 1 2015.
lower_date_limit (tuple) – The date at which to stop collecting new data. See upper_data_limit for formatting.
- counter¶
A flag to indicate to the client whether to stop fetching data given some condition (e.g., reaching a date limit).
- do_stop¶
Stores the id of the last fetched Tweet to handle pagination.