Sha256: b51532148f64cb9634e790af764b6cab5d50fd4204ff5d56046b83435de6e54c
Contents?: true
Size: 746 Bytes
Versions: 2
Compression:
Stored size: 746 Bytes
Contents
module Popularity class Soundcloud < Crawler stats :plays, :likes, :comments, :downloads def plays response.scan(/\"soundcloud:play_count\" content=\"([0-9]*)\"/).flatten.first.to_f.to_i end def likes response.scan(/\"soundcloud:like_count\" content=\"([0-9]*)\"/).flatten.first.to_f.to_i end def comments response.scan(/\"soundcloud:comments_count\" content=\"([0-9]*)\"/).flatten.first.to_f.to_i end def downloads response.scan(/\"soundcloud:download_count\" content=\"([0-9]*)\"/).flatten.first.to_f.to_i end def valid? host == 'soundcloud.com' end protected def response_json #not json! end def request_url @url end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
popularity-0.3.0 | lib/popularity/networks/soundcloud.rb |
popularity-0.2.1 | lib/popularity/networks/soundcloud.rb |