Class: SeoParams::Twitter
- Inherits:
-
Object
- Object
- SeoParams::Twitter
- Defined in:
- lib/seo_params/twitter.rb
Instance Method Summary collapse
-
#initialize(url) ⇒ Twitter
constructor
A new instance of Twitter.
- #tweets ⇒ Object
Constructor Details
#initialize(url) ⇒ Twitter
Returns a new instance of Twitter.
8 9 10 |
# File 'lib/seo_params/twitter.rb', line 8 def initialize(url) @url = url end |
Instance Method Details
#tweets ⇒ Object
12 13 14 15 16 |
# File 'lib/seo_params/twitter.rb', line 12 def tweets api_url = "http://urls.api.twitter.com/1/urls/count.json?url=#{@url}" response = JSON.parse(open(api_url).read) response["count"] end |