/share-counter

Check how many times a page/URL has been shared on social networks and aggregators

Primary LanguageRubyMIT LicenseMIT

Gem Version Code Climate Test Coverage Build Status Dependency Status

ShareCounter

Returns the number of shares for a link from

  • Twitter
  • Facebook
  • LinkedIn
  • Google+
  • Reddit
  • Delicious
  • StumbleUpon
  • Pinterest

Listed on RubyGems

Issue reports, feature requests and pull requests welcome.

Spiritual successor to the Share Counts gem.

Installation

gem install share-counter

Usage

2.1.1 :001 > require 'share-counter'
2.1.1 :002 > url = 'http://rinse.fm'

# get all
# note that facebook returns a hash
2.1.1 :003 > counts = ShareCounter.all url
 => {:reddit=>9, :twitter=>26329, :facebook=>{:commentsbox_count=>0, :click_count=>3870, :total_count=>73322, :comment_count=>13597, :like_count=>39899, :share_count=>19826}, :linkedin=>154, :googleplus=>2, :delicious=>5, :stumbleupon=>2087, :pinterest=>0}

# get specific networks
2.1.1 :004 > counts = ShareCounter.selected url, [:twitter, :linkedin]
 => {:twitter=>26329, :linkedin=>154}

# get one network
2.1.1 :005 > ShareCounter.twitter url
 => 25042