All Downloads are FREE. Search and download functionalities are using the official Maven repository.

talystcode.streaming-reddit_2.11.0.0.2.source-code.RedditDemo.scala Maven / Gradle / Ivy

The newest version!
import com.github.catalystcode.fortis.spark.streaming.reddit.RedditAuth
import org.apache.log4j.{BasicConfigurator, Level, Logger}

object RedditDemo {
  def main(args: Array[String]) {
    val mode = args.headOption.getOrElse("")

    // configure interaction with reddit api
    val auth = RedditAuth(
      applicationId = System.getenv("REDDIT_APPLICATION_ID"),
      secret = System.getenv("REDDIT_APPLICATION_SECRET")
    )

    // configure logging
    BasicConfigurator.configure()
    Logger.getRootLogger.setLevel(Level.ERROR)
    Logger.getLogger("lib-reddit").setLevel(Level.DEBUG)

    if (mode.contains("standalone")) new RedditDemoStandalone(auth).run()
    if (mode.contains("spark")) new RedditDemoSpark(auth).run()
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy