HarshitaYeole1 / twitter4s-demo

A collection of examples on how to use twitter4s

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

twitter4s-demo

Examples on how to use twitter4s library.

Usage

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.

TwitterRestClient Examples

  • 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 is src/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).

Bugs

Spotted some bugs? Please, raise them in the twitter4s issue section.

About

A collection of examples on how to use twitter4s

License:Apache License 2.0


Languages

Language:Scala 100.0%