Giter Club home page Giter Club logo

streaming-facebook's Introduction

A library for reading social data from Facebook using Spark Streaming.

Travis CI status

Usage example

Run a demo via:

# set up all the requisite environment variables
# you can create a new app id and secret here: https://developers.facebook.com/quickstarts/
# you can generate a new auth token here: https://developers.facebook.com/tools/accesstoken/
export FACEBOOK_APP_ID="..."
export FACEBOOK_APP_SECRET="..."
export FACEBOOK_AUTH_TOKEN="..."

# compile scala, run tests, build fat jar
sbt assembly

# run locally
java -cp target/scala-2.11/streaming-facebook-assembly-0.0.3.jar FacebookDemo standalone

# run on spark
spark-submit --class FacebookDemo --master local[2] target/scala-2.11/streaming-facebook-assembly-0.0.3.jar spark

How does it work?

Facebook doesn't expose a firehose API so we resort to polling. The FacebookReceiver pings the Facebook API every few seconds and pushes any new posts into Spark Streaming for further processing.

Currently, the following ways to read Facebook items are supported:

Release process

  1. Configure your credentials via the SONATYPE_USER and SONATYPE_PASSWORD environment variables.
  2. Update version.sbt
  3. Enter the SBT shell: sbt
  4. Run sonatypeOpen "enter staging description here"
  5. Run publishSigned
  6. Run sonatypeRelease

streaming-facebook's People

Contributors

c-w avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

streaming-facebook's Issues

Add ability to watch multiple pages

As per @erikschlegel:

enhance the existing connector to accept a pageIds: Set[String](as opposed to pageId: String) and have the connector open up a facebook4J connection per page and unionize the results

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.