Class: Popularity::Facebook
- Inherits:
-
Crawler
- Object
- Crawler
- Popularity::Facebook
show all
- Defined in:
- lib/popularity/networks/facebook.rb
Instance Attribute Summary
Attributes inherited from Crawler
#url
Instance Method Summary
collapse
Methods inherited from Crawler
#async_done?, #fetch, #fetch_async, #has_response?, #host, #initialize, #name, #response, #response_json, #to_json, #valid?
Instance Method Details
#as_json(options = {}) ⇒ Object
11
12
13
14
|
# File 'lib/popularity/networks/facebook.rb', line 11
def as_json(options = {})
{ "shares" => shares,
"comments" => }
end
|
7
8
9
|
# File 'lib/popularity/networks/facebook.rb', line 7
def
response_json['comments'].to_f.to_i
end
|
#shares ⇒ Object
3
4
5
|
# File 'lib/popularity/networks/facebook.rb', line 3
def shares
response_json['shares'].to_f.to_i
end
|
#total ⇒ Object
16
17
18
|
# File 'lib/popularity/networks/facebook.rb', line 16
def total
shares +
end
|