Twitter — Orange3 Text Mining documentation

# Twitter

class orangecontrib.text.twitter.Credentials(consumer_key, consumer_secret)

  Twitter API credentials.

  __init__(consumer_key, consumer_secret)

class orangecontrib.text.twitter.TwitterAPI(credentials)

  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)
  reset()

    Removes all downloaded tweets.

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

    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)

    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