belt / soshare
URL shares
dev-master / 1.0.x-dev
2014-10-26 16:46 UTC
Requires
- php: >=5.4.0
- belt/matter: 1.0.*@dev
- belt/underscore: 1.0.*@dev
- guzzlehttp/guzzle: 4.*
Requires (Dev)
- phpunit/phpunit: 4.*
This package is not auto-updated.
Last update: 2024-12-31 03:27:47 UTC
README
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:
- StumbleUpon
Installation
Via Composer.
$ composer require belt/soshare
Usage
Usage is really simple (as usual).
use Belt\Soshare; use Belt\Soshare\Reddit; use Belt\Soshare\Twitter; use Belt\Soshare\Facebook; use Belt\Soshare\LinkedIn; use Belt\Soshare\Pinterest; use Belt\Soshare\StumbleUpon; $soshare = new Soshare(); $soshare->addNetwork(new Reddit()); $soshare->addNetwork(new Twitter()); $soshare->addNetwork(new Facebook()); $soshare->addNetwork(new LinkedIn()); $soshare->addNetwork(new Pinterest()); $soshare->addNetwork(new StumbleUpon()); $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.