
talystcode.streaming-facebook_2.11.0.0.3.source-code.FacebookDemoStandalone.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of streaming-facebook_2.11 Show documentation
Show all versions of streaming-facebook_2.11 Show documentation
A library for reading social data from Facebook using Spark Streaming.
The newest version!
import java.util.Date
import com.github.catalystcode.fortis.spark.streaming.facebook.FacebookAuth
import com.github.catalystcode.fortis.spark.streaming.facebook.client.FacebookPageClient
class FacebookDemoStandalone(pageId: String, auth: FacebookAuth) {
def run(): Unit = {
val date = Some(new Date(new Date().getTime - 3600000 /* 1 hour */))
println(new FacebookPageClient(pageId, auth, Set("place", "comments", "message")).loadNewFacebookPosts(date).toList)
println(new FacebookPageClient(pageId, auth, Set("place", "comments", "message")).loadNewFacebookComments(date).toList)
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy