Coder Social home page Coder Social logo

hadasiii / facebook-insight-stream Goto Github PK

View Code? Open in Web Editor NEW

This project forked from panoplyio/facebook-insight-stream

0.0 0.0 0.0 57 KB

Readable stream built over node-streams, provide stream api to read facebook insights

JavaScript 100.00%

facebook-insight-stream's Introduction

facebook-insight-stream

FacebookInsightStream provide stream API, built over node-readable-stream, to read facebook insights using the facebook Graph API V2.10. Currently facebook insights api return data per metric, this module joins all the list to one list by the insight date.

Currently support the following insights:

Usage

var FacebookInsightStream = require( "facebook-insight-stream" );

var options = {
    pastdays: "30",
    node: "page",
    token: "Replace with your facebook access token",
    period: "day",
    metrics: ["page_views"],
    itemList: ["replace with your facebook page id"],
}

var pageStream = new FacebookInsightStream( options )
    //  return list of insights  e.g [ { name: "mypage", views: "10" } ]
    .on( "data", console.log )
    // "oAuth error"
    .on( "error", console.log )
    // progress status  { total: "2", loaded: "1", message: "{{remaining}} pages remain"  }
    .on( "progress", console.log )

FacebookInsightStream options:

  • pastdays (string-required)#number of collected days from today e.g "30"
  • node (string-required)#type of insight one of the two ( "app", "page" )
  • token (string-required)#valid facebook oAuth token with 'read_insigt' scope
  • period (string-required)#the time period to collect according to the relevant api
  • metrics (array-required)#list of metrics to collect e.g [ "page_views", "unique_users" ]
  • itemList (array-required)#list of pages/apps ids to collect from
  • events (array)#list of events to collect from
  • aggregate (bool)#value to set if it should aggregate by relevant types
  • breakdowns (array)#list of breakdowns values to break results

facebook-insight-stream's People

Contributors

oshribin avatar alonbrody avatar liorrozen avatar avinoamr avatar kensaggy avatar

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.