socializr
Read data streams from several social networks.
Last updated 5 years ago by bigmountainideas .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install socializr 
SYNC missed versions from official npm registry.

socializr

Consumer realtime data updates from Twitter, Facebook, Instagram and Google Plus into node Stream objects.

NPM Version NPM Downloads Build Coverage Status

INSTALLING

$ npm install socializr --save

API

Socializr
Providers
  • Twitter
  • Google Plus
  • Facebook
  • Instagram

Examples


var socializr = require('socializr');

var twitterProvider = new socializr.Twitter({
  key: 'a valid twitter api key',
  secret: 'a valid twitter api secret',
  filters: [
    function(obj) {
      return !obj.data.hasOwnProperty('retweeted_status');
    }
  ]
});



var gplusProvider = new socializr.GooglePlus({
  key: 'a valid api key',
  filters: [
    function(obj) {
      return !(obj.provider && obj.provider.title === 'Reshared Post');
    }
  ]
});


callback_domain.pathname = '/pubsub/__cb__/facebook';

var facebookProvider = new socializr.Facebook({
  appId: 'a valid facebook app id',
  appSecret: 'a valid facebook app secret',
  subscriptionCallbackURL: url.format(callback_domain)
});

callback_domain.pathname = '/pubsub/__cb__/instagram';

var instagramProvider = new socializr.Instagram({
  appId: 'a valid instagram app/ client id',
  appSecret: 'a valid instagram app/ client secret',
  subscriptionCallbackURL: url.format(callback_domain),
  filters: [
    function(obj) {
      return obj.caption && obj.caption.text && obj.caption.text.length;
    }
  ]
});

var social = socializr();




var auths_twitter    = twitterProvider.auth auth.twitter.users[0]
var auths_gplus      = gplusProvider.auth auth.gplus.app
var auths_facebook   = facebookProvider.auth auth.facebook.app
var auths_instagram  = instagramProvider.auth auth.instagram.app


instagramProvider.subscribe( {type: 'user'}, function(){

});

facebookProvider.subscribe( 'page', function(){

});


social.on( 'warning', function(warn){
  debug( 'Socializr warning', warn);
});


social.on( 'data', function(obj){

});


Twitter

var twitter = new socializr.Twitter({
  key: 'TWITTER_API_KEY',
  secret: 'TWITTER_API_SECRET'
}, {
  filters: [
    function(obj) {
      return !obj.hasOwnProperty('retweeted_status');
    }
  ]
});

var social = socializr([twitter]);

var auths = [
  twitter.auth({
    user: 'USER_ID',
    token: 'USER_ACCESS_TOKEN',
    secret: 'USER_TOKEN_SECRET'
  })
];

social.on('warning', function(err) {
    return console.log('error', err);
  });

social.on('data', function(msg) {
    return console.log(msg);
  });

Add data to stream

social.stream({
  tags: ['Toronto', '#applehot'],
  users: [972651, 759251],
  language: 'en'
}, auths);

If you need to add new tags or users just call the stream function again with the updated data.

Issues & Feature Requests

If you have any issues or feature requests please file them in github.com issues. Thanks for your support and comments.

TODO

  • Twitter stream fallback

LICENSE

(The MIT License)

Copyright (c) 2015 Big Mountain Ideas + Innovations <jovan@bigmountainideas.com>

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Current Tags

  • 0.2.42                                ...           latest (5 years ago)

77 Versions

  • 0.2.42                                ...           5 years ago
  • 0.2.41                                ...           6 years ago
  • 0.2.40                                ...           6 years ago
  • 0.2.39                                ...           6 years ago
  • 0.2.38                                ...           6 years ago
  • 0.2.37                                ...           6 years ago
  • 0.2.36                                ...           6 years ago
  • 0.2.35                                ...           6 years ago
  • 0.2.34                                ...           6 years ago
  • 0.2.33                                ...           6 years ago
  • 0.2.32                                ...           6 years ago
  • 0.2.31                                ...           6 years ago
  • 0.2.30                                ...           6 years ago
  • 0.2.29                                ...           6 years ago
  • 0.2.28                                ...           6 years ago
  • 0.2.27                                ...           6 years ago
  • 0.2.26                                ...           6 years ago
  • 0.2.25                                ...           6 years ago
  • 0.2.24                                ...           6 years ago
  • 0.2.21                                ...           6 years ago
  • 0.2.20                                ...           6 years ago
  • 0.2.19                                ...           6 years ago
  • 0.2.18                                ...           6 years ago
  • 0.2.17                                ...           6 years ago
  • 0.2.16                                ...           6 years ago
  • 0.2.15                                ...           6 years ago
  • 0.2.14                                ...           6 years ago
  • 0.2.13                                ...           6 years ago
  • 0.2.12                                ...           6 years ago
  • 0.2.11                                ...           6 years ago
  • 0.2.10                                ...           6 years ago
  • 0.2.9                                ...           6 years ago
  • 0.2.8                                ...           6 years ago
  • 0.2.7                                ...           6 years ago
  • 0.2.6                                ...           6 years ago
  • 0.2.5                                ...           6 years ago
  • 0.2.4                                ...           6 years ago
  • 0.2.3                                ...           6 years ago
  • 0.2.2                                ...           6 years ago
  • 0.2.1                                ...           6 years ago
  • 0.2.0                                ...           6 years ago
  • 0.1.3                                ...           6 years ago
  • 0.1.2                                ...           6 years ago
  • 0.1.1                                ...           6 years ago
  • 0.1.0                                ...           6 years ago
  • 0.0.33                                ...           6 years ago
  • 0.0.32                                ...           6 years ago
  • 0.0.31                                ...           6 years ago
  • 0.0.30                                ...           6 years ago
  • 0.0.29                                ...           6 years ago
  • 0.0.28                                ...           6 years ago
  • 0.0.27                                ...           6 years ago
  • 0.0.26                                ...           6 years ago
  • 0.0.25                                ...           6 years ago
  • 0.0.24                                ...           6 years ago
  • 0.0.23                                ...           6 years ago
  • 0.0.22                                ...           6 years ago
  • 0.0.21                                ...           6 years ago
  • 0.0.20                                ...           6 years ago
  • 0.0.19                                ...           6 years ago
  • 0.0.18                                ...           6 years ago
  • 0.0.17                                ...           6 years ago
  • 0.0.16                                ...           6 years ago
  • 0.0.15                                ...           6 years ago
  • 0.0.14                                ...           6 years ago
  • 0.0.13                                ...           6 years ago
  • 0.0.12                                ...           6 years ago
  • 0.0.11                                ...           6 years ago
  • 0.0.10                                ...           6 years ago
  • 0.0.9                                ...           6 years ago
  • 0.0.8                                ...           6 years ago
  • 0.0.7                                ...           6 years ago
  • 0.0.6                                ...           6 years ago
  • 0.0.5                                ...           6 years ago
  • 0.0.4                                ...           6 years ago
  • 0.0.3                                ...           6 years ago
  • 0.0.1                                ...           6 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (7)
Dev Dependencies (8)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |