soc

socialcountstracker

Social counts for a given URL from FB, Twitter, Google+, StumbleUpon and Pinterest

Showing:

Popularity

Downloads/wk

1

GitHub Stars

3

Maintenance

Last Commit

7yrs ago

Contributors

1

Package

Dependencies

5

Size (min+gzip)

0.2KB

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

socialcounts

Social counts for a given URL from FB, LinkedIn Twitter, Google+, StumbleUpon and Pinterest. It can be used as an API for your node application. Data is retrieved from the official buttons provided by the networks.

Requirements

Need to install mongodb if you want to have a cache layer for your data.

Mongodb

Endpoints

https://api.facebook.com/method/links.getStats?urls=%%URL%%&format=json
http://urls.api.twitter.com/1/urls/count.json?url=%%URL%%&callback=twttr.receiveCount
http://www.linkedin.com/cws/share-count?url=%%URL%%
http://www.stumbleupon.com/services/1.01/badge.getinfo?url=%%URL%%
http://widgets.pinterest.com/v1/urls/count.json?source=6&url=%%URL%%
https://clients6.google.com/rpc?key=google_key (POST)

Installation

$ npm install socialcountstracker

Usage

API

var socialcounts = require('socialcountstracker');

// Options that you can pass
// Following are the defaults

var options = {
  mongoActive: true,
  host: 'mongodb://localhost/socialcounts',
  limitResults: 100,
  // How long it uses the prev result, without inserting a new one
  cache_refresh: 24 * 3600,
  collectionName: 'social',
  facebook: true,
  twitter: true,
  pinterest: true,
  linkedin: true,
  googlePlus: true,
  stumbleUpon: true,
  google_token: ''  // TODO: Pass your google API Token
};

socialcounts.start({twitter: false, googlePlus: false}, function (instance) {
  instance.getSocialCounts('www.ign.com', function (err, results) {
    console.log(results);
  });

  instance.getSocialCounts('www.as.com', function (err, results) {
    console.log(results);
  });

  instance.getSocialCounts('www.nytimes.com', function (err, results) {
    console.log(results);
  });
});

Testing

$ npm run test

Or if you are changing lots of things:

$ npm run autotest

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial