This package has been deprecated

Author message:

No longer maintained

cher-facebook

0.3.2 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i cher-facebook

Weekly Downloads

2

Version

0.3.2

License

MIT

Last publish

Collaborators

  • recursivefunk
  • istrategylabs