lib/popularity/networks/facebook.rb in popularity-0.1.1 vs lib/popularity/networks/facebook.rb in popularity-0.2.1
- old
+ new
@@ -1,26 +1,19 @@
module Popularity
class Facebook < Crawler
+ stats :shares, :comments
+
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
+ def request_url
+ "http://graph.facebook.com/?id=#{@url}"
+ end
+ end
end