Returns the number of shares for a link from
- Google+
- Delicious
- StumbleUpon
Listed on RubyGems
Issue reports, feature requests and pull requests welcome.
Spiritual successor to the Share Counts gem.
gem install share-counter
2.1.1 :001 > require 'share-counter'
2.1.1 :002 > url = 'http://rinse.fm'
# get all
2.1.1 :003 > counts = ShareCounter.all url
=> {:reddit=>9, :twitter=>25042, :facebook=>37699, :linkedin=>154, :googleplus=>1, :delicious=>-1, :stumbleupon=>2087, :pinterest=>0}
# note delicious count. -1 means an error prevented the count being retrieved
# get specific networks
2.1.1 :004 > counts = ShareCounter.selected url, [:facebook, :linkedin]
=> {:facebook=>37699, :linkedin=>154}
# get one network
2.1.1 :005 > ShareCounter.twitter url
=> 25042