Twitter¶
A module for fetching data from The Twitter Search API.
-
class
orangecontrib.text.twitter.Credentials(consumer_key, consumer_secret)[source]¶ Twitter API credentials.
-
valid¶ bool: Indicates whether it’s a valid credentials.
-
-
class
orangecontrib.text.twitter.TwitterAPI(credentials, on_start=None, on_progress=None, on_error=None, on_finish=None)[source]¶ Fetch tweets from the Tweeter API.
Notes
Every search accumulates downloaded tweets. To remove the stored tweets call reset method.
-
create_corpus(included_attributes=None)[source]¶ Creates a corpus with collected tweets.
Parameters: included_attributes (Optional[List of string]) – A list of tweets’ attributes to be included in the result.
-
running¶ bool: Indicates whether there is an active task.
-
search(*, word_list=None, authors=None, max_tweets=None, lang=None, since=None, until=None, allow_retweets=True)[source]¶ Performs search for tweets.
All the parameters optional.
Parameters: - max_tweets (int) – If present limits the number of downloaded tweets.
- word_list (list of str) – A list of key words to search for.
- authors (list of str) – A list of tweets’ author.
- lang (str) – A language’s code (either ISO 639-1 or ISO 639-3 formats).
- since (str) – Fetch tweets only from this date.
- until (str) – Fetch tweets only to this date.
- allow_retweets (bool) – Whether to download retweets.
-
tweets¶ Iterator over the downloaded documents.
-