Class: BackTyper::Tweets

Inherits:
Client
  • Object
show all
Defined in:
lib/backtyper/tweets.rb

Class Method Summary collapse

Methods inherited from Client

authenticate, rate_limit

Class Method Details

.by_url(q, options = {}) ⇒ Object

Retrieve tweets that link to a given URL, whether the links are shortened or unshortened.

q = The url to return number of tweets for


19
20
21
22
# File 'lib/backtyper/tweets.rb', line 19

def self.by_url(q, options={})
  response = get('/tweets/search/links.json', :query => {:q => q}.merge(options))
  handle_response(response)
end

.count(q, options = {}) ⇒ Object

Retrieve the number of tweets that link to a particular URL.

q = The url to return number of tweets for


9
10
11
12
# File 'lib/backtyper/tweets.rb', line 9

def self.count(q, options={})
  response = get('/tweetcount.json', :query => {:q => q}.merge(options))
  handle_response(response)
end

.good(q, options = {}) ⇒ Object

Retrieve filtered tweets that link to a given URL with both shortened and unshortened links. This returns a subset of Tweets by URL, but it filters tweets linking to a URL for quality. This skips all the tweets that only contain the page title, etc.

q = The url to return number of tweets for


31
32
33
34
# File 'lib/backtyper/tweets.rb', line 31

def self.good(q, options={})
  response = get('/goodtweets.json', :query => {:q => q}.merge(options))
  handle_response(response)
end