Skip to content

Repository files navigation

Belt.Soshare

Software LicenseBuild StatusCoverage StatusQuality Score

Shared URLs

Belt.Soshare is an utility library that allows you to easily check the number of shares an URL has for a given social network (or all social networks).

Supported networks:

  • Twitter
  • Facebook
  • LinkedIn
  • reddit
  • Pinterest
  • StumbleUpon

Installation

Via Composer.

$ composer require belt/soshare

Usage

Usage is really simple (as usual).

useBelt\Soshare;
useBelt\Soshare\Reddit;
useBelt\Soshare\Twitter;
useBelt\Soshare\Facebook;
useBelt\Soshare\LinkedIn;
useBelt\Soshare\Pinterest;
useBelt\Soshare\StumbleUpon;
$soshare = newSoshare();
$soshare->addNetwork(newReddit());
$soshare->addNetwork(newTwitter());
$soshare->addNetwork(newFacebook());
$soshare->addNetwork(newLinkedIn());
$soshare->addNetwork(newPinterest());
$soshare->addNetwork(newStumbleUpon());
$soshare->getShares('http://apple.com');
$soshare->getShares('http://apple.com', ['twitter']); // Only get shares on Twitter$soshare->getShares('http://apple.com', ['facebook', 'reddit']); // Only get shares on Facebook and Reddit$soshare->getSharesByNetwork('http://apple.com'); // Get the shares seperated by network// => [ 'twitter' => 32, 'facebook' => 1337, ... ]

Contributing

Please see CONTRIBUTING.

Credits

This library is based on social-shares for Ruby. If you're building something in Ruby and you need functionality like this, I recommend you check this library out!

License

Please see LICENSE.

About

Shared URLs

Resources

Contributing

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages