0.3.2 • Published 8 years ago

cher-facebook v0.3.2

Weekly downloads
3
License
MIT
Repository
github
Last release
8 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

8 years ago

0.3.1

8 years ago

0.3.0

8 years ago

0.2.4

8 years ago

0.2.3

9 years ago

0.2.2

9 years ago

0.2.1

9 years ago

0.2.0

9 years ago

0.1.6

9 years ago

0.1.5

9 years ago

0.1.4

9 years ago

0.1.3

9 years ago

0.1.2

9 years ago

0.1.0

9 years ago

0.0.1

9 years ago