
talystcode.streaming-reddit_2.11.0.0.2.source-code.RedditDemoStandalone.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of streaming-reddit_2.11 Show documentation
Show all versions of streaming-reddit_2.11 Show documentation
A library for reading public web postings from Reddit using Spark Streaming.
The newest version!
import java.util.Date
import com.github.catalystcode.fortis.spark.streaming.reddit.RedditAuth
import com.github.catalystcode.fortis.spark.streaming.reddit.client.RedditClient
class RedditDemoStandalone(auth: RedditAuth) {
def run(): Unit = {
val keywords = List("healthcare")
val client = new RedditClient(auth.applicationId, auth.secret)
client.ensureFreshToken()
println(client.search(keywords, limit = 2).toList)
client.ensureFreshToken()
client.revokeToken()
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy