Class: SeoParams::Twitter

Inherits:
Object
  • Object
show all
Defined in:
lib/seo_params/twitter.rb

Instance Method Summary collapse

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

#tweetsObject



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