Twitter

class orangecontrib.text.twitter.Credentials(consumer_key, consumer_secret)[source]

Twitter API credentials.

__init__(consumer_key, consumer_secret)[source]
class orangecontrib.text.twitter.TwitterAPI(credentials)[source]

Fetch tweets from the Tweeter API.

Notes

Results across multiple searches are aggregated. To remove tweets form previous searches and only return results from the last search either call reset method before searching or provide collecting=False argument to search method.

__init__(credentials)[source]
reset()[source]

Removes all downloaded tweets.

search_authors(authors, *, max_tweets=0, collecting=False, callback=None)[source]

Search by authors.

Parameters
  • authors (list of str) – A list of authors to search for.

  • max_tweets (int) – If greater than zero limits the number of downloaded tweets.

  • collecting (bool) – Whether to collect results across multiple search calls.

Returns

Corpus

search_content(content, *, max_tweets=0, lang=None, allow_retweets=True, collecting=False, callback=None)[source]

Search by content.

Parameters
  • content (list of str) – A list of key words to search for.

  • max_tweets (int) – If greater than zero limits the number of downloaded tweets.

  • lang (str) – A language’s code (either ISO 639-1 or ISO 639-3 formats).

  • allow_retweets (bool) – Whether to download retweets.

  • collecting (bool) – Whether to collect results across multiple search calls.

Returns

Corpus