lib/popularity/networks/medium.rb in popularity-0.1.1 vs lib/popularity/networks/medium.rb in popularity-0.2.1
- old
+ new
@@ -1,19 +1,13 @@
module Popularity
class Medium < Crawler
+ stats :recommends
+
def recommends
response_json["payload"]["value"]["count"]
end
- def as_json(options = {})
- {"recommends" => recommends}
- end
-
- def total
- recommends
- end
-
def valid?
host == 'medium.com'
end
protected
@@ -28,6 +22,6 @@
def response_json
JSON.parse(response.sub("])}while(1);</x>", ""))
end
end
-end
\ No newline at end of file
+end