Sha256: 650ffb48e27b9478f05e641d2b925b49b6376c8ec76648848eb66b1947d38b6b

Contents?: true

Size: 416 Bytes

Versions: 3

Compression:

Stored size: 416 Bytes

Contents

module Popularity
	class Facebook < Crawler
    def shares
      response_json['shares'].to_f.to_i
    end

    def comments
      response_json['comments'].to_f.to_i
    end

    def as_json(options = {})
      { "shares" => shares,
        "comments" => comments }
    end

    def total
       shares + comments
    end

    protected

		def request_url
			"http://graph.facebook.com/?id=#{@url}"
		end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
popularity-0.1.1 lib/popularity/networks/facebook.rb
popularity-0.1.0 lib/popularity/networks/facebook.rb
popularity-0.0.1 lib/popularity/facebook.rb