Socket
Socket
Sign inDemoInstall

cher-facebook

Package Overview
Dependencies
224
Maintainers
2
Versions
15
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    cher-facebook

A source stream implementation for [cher](https://github.com/istrategylabs/cher)


Version published
Weekly downloads
16
increased by700%
Maintainers
2
Install size
21.8 MB
Created
Weekly downloads
 

Readme

Source

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

FAQs

Last updated on 20 Jun 2016

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc