Get the share counts of URLs from various social networks
PHP
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
demo
src
.gitignore
LICENSE.txt
README.md
composer.json

README.md

#ShareCount

Get the share counts of URLs from various social networks

Example

##Usage

Quick setup:

include_once "/path/to/sharecount.class.php";

$share_count = new ShareCount("http://github.com");
echo $share_count->facebook();

There are a few different ways to set the URL you'd like to check. The example above sets the URL globally for all functions to follow within the $share_count variable.

You can also set the URL on the fly with:

$share_count = new ShareCount();
$share_count->url("http://github.com");
echo $share_count->facebook();

Finally, you can set the URL for individual social networks:

$share_count = new ShareCount();
echo $share_count->facebook("http://github.com");

##Support

There are 5 social networks included: Facebook, Google Plus, LinkedIn, Pinterest, Twitter.

The counts for all of the social networks can be accessed by their own functions:

echo $share_count->facebook();
echo $share_count->gplus();
echo $share_count->linkedin();
echo $share_count->pinterest();
echo $share_count->twitter();