socializr / 0.2.42 last updated 10 months ago created on Mar 13th 2014

Install

npm install --save socializr

Clone

git clone git@github.com:bigmountainideas/socializr.git

dependencies show all 19

main MD5 1.3.0 BSD 3-Clause
superagent 0.17.0 MIT
async 0.6.2 MIT
pragma-scheduler 1.0.5 MIT
node-uuid 1.4.7 MIT

maintainers

bigmountainideas

versions 77 total

0.2.42 10 months ago bigmountainideas
0.2.41 a year ago bigmountainideas
0.2.40 a year ago bigmountainideas
0.2.39 a year ago bigmountainideas
0.2.38 a year ago bigmountainideas
0.2.37 a year ago bigmountainideas
0.2.36 a year ago bigmountainideas
0.2.35 a year ago bigmountainideas
0.2.34 a year ago bigmountainideas
0.2.33 a year ago bigmountainideas
0.2.32 a year ago bigmountainideas
0.2.31 2 years ago bigmountainideas
0.2.30 2 years ago bigmountainideas
0.2.29 2 years ago bigmountainideas
0.2.28 2 years ago bigmountainideas
0.2.27 2 years ago bigmountainideas
0.2.26 2 years ago bigmountainideas
0.2.25 2 years ago bigmountainideas
0.2.24 2 years ago bigmountainideas
0.2.21 2 years ago bigmountainideas
0.2.20 2 years ago bigmountainideas
0.2.19 2 years ago bigmountainideas
0.2.18 2 years ago bigmountainideas
0.2.17 2 years ago bigmountainideas
0.2.16 2 years ago bigmountainideas
0.2.15 2 years ago bigmountainideas
0.2.14 2 years ago bigmountainideas
0.2.13 2 years ago bigmountainideas
0.2.12 2 years ago bigmountainideas
0.2.11 2 years ago bigmountainideas
0.2.10 2 years ago bigmountainideas
0.2.9 2 years ago bigmountainideas
0.2.8 2 years ago bigmountainideas
0.2.7 2 years ago bigmountainideas
0.2.6 2 years ago bigmountainideas
0.2.5 2 years ago bigmountainideas
0.2.4 2 years ago bigmountainideas
0.2.3 2 years ago bigmountainideas
0.2.2 2 years ago bigmountainideas
0.2.1 2 years ago bigmountainideas
0.2.0 2 years ago bigmountainideas
0.1.3 2 years ago bigmountainideas
0.1.2 2 years ago bigmountainideas
0.1.1 2 years ago bigmountainideas
0.1.0 2 years ago bigmountainideas
0.0.33 2 years ago bigmountainideas
0.0.32 2 years ago bigmountainideas
0.0.31 2 years ago bigmountainideas
0.0.30 2 years ago bigmountainideas
0.0.29 2 years ago bigmountainideas
0.0.28 2 years ago bigmountainideas
0.0.27 2 years ago bigmountainideas
0.0.26 2 years ago bigmountainideas
0.0.25 2 years ago bigmountainideas
0.0.24 2 years ago bigmountainideas
0.0.23 2 years ago bigmountainideas
0.0.22 2 years ago bigmountainideas
0.0.21 2 years ago bigmountainideas
0.0.20 2 years ago bigmountainideas
0.0.19 2 years ago bigmountainideas
0.0.18 2 years ago bigmountainideas
0.0.17 2 years ago bigmountainideas
0.0.16 2 years ago bigmountainideas
0.0.15 2 years ago bigmountainideas
0.0.14 2 years ago bigmountainideas
0.0.13 2 years ago bigmountainideas
0.0.12 2 years ago bigmountainideas
0.0.11 2 years ago bigmountainideas
0.0.10 2 years ago bigmountainideas
0.0.9 2 years ago bigmountainideas
0.0.8 2 years ago bigmountainideas
0.0.7 2 years ago bigmountainideas
0.0.6 2 years ago bigmountainideas
0.0.5 2 years ago bigmountainideas
0.0.4 2 years ago bigmountainideas
0.0.3 2 years ago bigmountainideas
0.0.1 2 years ago bigmountainideas
0 Downloads yesterday.

readme

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

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

1
2
3
4
5
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.
Resolving all dependencies.. This could take a while as our cache is not yet fully warmed up.