0.3.2 • Published 9 years ago

cher-facebook v0.3.2

Weekly downloads
3
License
MIT
Repository
github
Last release
9 years ago

cher-facebook

A source stream implementation for cher

Requirements

  1. Node >= 4.2.1
  2. npm >= 3.3.3

Install Dependencies

$ npm install

Usage

  const Cher = require('cher');
  const tools = require('cher-tools');
  const cherFacebook = require('cher-facebook');
  const save = tools.pipeline.save;
  // config helper
  const config = tools.utils.config;  

  // Cher streams get configured here.
  const sourceStreams = [
    {
      name: 'facebook',
      module: cherFacebook
    }
  ];  

  config.fetch({
    pipeline: [ save ],
    sourceStreams: sourceStreams    
  })
  .then(Cher.construct)
  .spread((streams, cher) => {
      const facebookSource = cher.getStream('facebook');
      facebookSource
        .start()
        .spread((dataChannel, facebookSettings) => {
          dataChannel.on('data', (data) => {
            console.log(data) // a facebook post or comment or whatever
          });
        });
    });

Tests

Setup some environment variables

$ echo "FACEBOOK_CLIENT_ID=<your_client_id>" >> test/test.env
$ echo "FACEBOOK_CLIENT_SECRET=<your_client_secret>" >> test/test.env
$ echo "facebookAccessToken=<your_really_long_access_token>" >> test/test.env
$ echo "PAGES=<a_fb_page_id>" >> test/test.env
$ echo "POSTS=<a_fb_post_id_with_comments>" >> test/test.env

Run em'

$ npm test
0.3.2

9 years ago

0.3.1

10 years ago

0.3.0

10 years ago

0.2.4

10 years ago

0.2.3

10 years ago

0.2.2

10 years ago

0.2.1

10 years ago

0.2.0

10 years ago

0.1.6

10 years ago

0.1.5

10 years ago

0.1.4

10 years ago

0.1.3

10 years ago

0.1.2

10 years ago

0.1.0

10 years ago

0.0.1

10 years ago