Getting Social Share Counts with Pure JavaScript – socialcount.js

Category: Javascript , Social Media | December 1, 2015
Author:olahol
Views Total:1,253 views
Official Page:Go to website
Last Update:December 1, 2015
License:MIT

Preview:

Getting Social Share Counts with Pure JavaScript – socialcount.js

Description:

socialcount.js is a tiny JavaScript library for getting the counts that a specific website (URL) has been shared on popular social networks like Pinterest, Facebook, Twitter and Google Plus.

How to use it:

Just include the socialcount.js library on the webpage and we’re ready to go.

<script src="socialcount.js"></script>

Get share count from a specific social network.

// Socialcount.get(provider, url, callback(count))
Socialcount.get("facebook", "http://www.google.com", function (count) {
  console.log(count); 
});

Get all share counts from available social networks.

// Socialcount.all(url, callback(counts))
Socialcount.all("http://www.google.com", function (counts) {
  console.log(counts); 
});

Get share counts for the current page address.

Socialcount.get(provider, callback(count))
// or
Socialcount.all(callback(counts))

You Might Be Interested In:


Leave a Reply