Examples on how to use twitter4s library.
Make sure to set up your consumer and access tokens -- see twitter4s README - Usage Section for more information.
Run the examples with sbt run
and choose the main to run.
- MyTopHashtags displays the top 10 most common hashtags in the home timeline (i.e.: the timeline of the authenticated user).
- SearchAndSaveTweets searches all the tweets matching some query and it saves the result as JSON in a file. In this example, the query used is
#scalax
and the generated file issrc/main/resources/tweets/scalax.json
. - SimpleStatistics loads tweets from a file, in this case
src/main/resources/tweets/scalax.json
, and it computes some simple statistics: top hashtags, top active users, top mentioned users, top retweets, top favorite tweets. - UserTopHashtags displays the top 10 most common hashtags in a user timeline. In this example, we use Martin Odersky's account.
- TrendingTopics displays the top 10 trending topics worldwide, and in a given location (by text and by geolocation).
Spotted some bugs? Please, raise them in the twitter4s issue section.