Class: Popularity::Soundcloud
- Inherits:
-
Crawler
- Object
- Crawler
- Popularity::Soundcloud
show all
- Defined in:
- lib/popularity/networks/soundcloud.rb
Instance Attribute Summary
Attributes inherited from Crawler
#url
Instance Method Summary
collapse
Methods inherited from Crawler
#as_json, #async_done?, #fetch, #fetch_async, #has_response?, #host, #initialize, #name, property_names, #response, stats, #total
Instance Method Details
13
14
15
|
# File 'lib/popularity/networks/soundcloud.rb', line 13
def
response.scan(/\"soundcloud:comments_count\" content=\"([0-9]*)\"/).flatten.first.to_f.to_i
end
|
#downloads ⇒ Object
17
18
19
|
# File 'lib/popularity/networks/soundcloud.rb', line 17
def downloads
response.scan(/\"soundcloud:download_count\" content=\"([0-9]*)\"/).flatten.first.to_f.to_i
end
|
#likes ⇒ Object
9
10
11
|
# File 'lib/popularity/networks/soundcloud.rb', line 9
def likes
response.scan(/\"soundcloud:like_count\" content=\"([0-9]*)\"/).flatten.first.to_f.to_i
end
|
#plays ⇒ Object
5
6
7
|
# File 'lib/popularity/networks/soundcloud.rb', line 5
def plays
response.scan(/\"soundcloud:play_count\" content=\"([0-9]*)\"/).flatten.first.to_f.to_i
end
|
#valid? ⇒ Boolean
21
22
23
|
# File 'lib/popularity/networks/soundcloud.rb', line 21
def valid?
host == 'soundcloud.com'
end
|