Created
January 5, 2017 11:27
-
-
Save kamijin-fanta/60de646e9ae38a483a46e8cb8fe3c9e2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> run | |
[info] Running main | |
[info] Pooling... | |
[info] [INFO] [01/05/2017 20:19:26.965] [default-akka.actor.default-dispatcher-2] [akka.actor.ActorSystemImpl(default)] HttpMethod(GET) https://stream.twitter.com/1.1/statuses/sample.json?language=ja&stall_warnings=false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import akka.actor.{ActorSystem} | |
import com.danielasfregola.twitter4s.entities.enums.Language | |
import com.danielasfregola.twitter4s.{TwitterStreamingClient} | |
import com.danielasfregola.twitter4s.entities.{Tweet} | |
object main { | |
def main(args: Array[String]): Unit = { | |
implicit val system = ActorSystem() | |
val streamingClient = TwitterStreamingClient() | |
streamingClient.sampleStatuses(Seq(Language.Japanese)) { | |
case tweet: Tweet => println(tweet.text) | |
} | |
println("Pooling...") | |
if (io.StdIn.readLine != null) { | |
println("Shutdown") | |
system.terminate() | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment