Sha256: 6b1db990930d4205232d48da95f1c5acf694fcb3e47d78a08a534c05155f7989
Contents?: true
Size: 518 Bytes
Versions: 3
Compression:
Stored size: 518 Bytes
Contents
module Popularity class RedditComment < Crawler def score response_json[1]["data"]["children"][0]["data"]["score"] end def as_json(options = {}) {"score" => score} end def total score end def valid? return false unless host == 'reddit.com' path = URI.parse(@url).path path.split('/').delete_if { |a| a.empty? }.size == 6 end def name "reddit" end protected def request_url "#{@url}.json" end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
popularity-0.1.1 | lib/popularity/networks/reddit_comment.rb |
popularity-0.1.0 | lib/popularity/networks/reddit_comment.rb |
popularity-0.0.1 | lib/popularity/reddit_comment.rb |