Module: Topsy
- Defined in:
- lib/topsy/tag.rb,
lib/topsy.rb,
lib/topsy/page.rb,
lib/topsy/stats.rb,
lib/topsy/trend.rb,
lib/topsy/tweet.rb,
lib/topsy/author.rb,
lib/topsy/client.rb,
lib/topsy/target.rb,
lib/topsy/version.rb,
lib/topsy/linkpost.rb,
lib/topsy/url_info.rb,
lib/topsy/search_counts.rb,
lib/topsy/linkpost_count.rb,
lib/topsy/rate_limit_info.rb,
lib/topsy/search_histogram.rb,
lib/topsy/link_search_result.rb
Overview
This is the link_search_result class for the topsy library. A LinkSearchResult has the following attributes:
"trackback_permalink" : "http://twitter.com/ewerickson/status/3562164195",
"hits" : 38,
"trackback_total" : 157,
"topsy_trackback_url" : "http://topsy.com/tb/www.redstate.com/erick/2009/08/26/breaking-rumors-surface-that-leon-panetta-is-resigning/",
"url" : "http://www.redstate.com/erick/2009/08/26/breaking-rumors-surface-that-leon-panetta-is-resigning/",
"content" : "Panetta is rumored to have sent a resignation letter to Barack Obama today: http://bit.ly/CDMg9",
"title" : "BREAKING: Rumors Surface That Leon Panetta is Resigning - Erickâs blog - RedState",
"score" : 0.75521481,
"highlight" : "Panetta is rumored to have sent a resignation letter to
<span class=\"highlight-term\">Barack</span> <span class=\"highlight-term\">Obama</span> today: http://bit.ly/CDMg9"
According to the official Topsy doc: code.google.com/p/otterapi/wiki/Resources?tm=6#/search
Defined Under Namespace
Classes: Author, Client, General, InformTopsy, LinkSearchResult, Linkpost, LinkpostCount, NotFound, Page, RateLimitExceeded, RateLimitInfo, SearchCounts, SearchHistogram, Stats, Tag, Target, TopsyError, Trend, Tweet, Unauthorized, Unavailable, UrlInfo
Constant Summary collapse
- VERSION =
'0.6.0'
Class Method Summary collapse
-
.author_info(url) ⇒ Topsy::Author
Returns profile information for an author (a twitter profile indexed by Topsy).
-
.credit ⇒ Topsy::RateLimitInfo
Returns info about API rate limiting.
-
.experts(q, options = {}) ⇒ Topsy::Page
Returns list of authors that talk about the query.
-
.link_post_count(url, options = {}) ⇒ Topsy::LinkpostCount
Returns count of links posted by an author.
-
.link_posts(url, options = {}) ⇒ Topsy::Page
Returns list of URLs posted by an author.
-
.profile_search(q, options = {}) ⇒ Topsy::Page
Returns list list of author profiles that match the query.
- .rate_limit ⇒ Object
- .rate_limit=(info) ⇒ Object
-
.related(url, options = {}) ⇒ Topsy::Page
Returns list of URLs related to a given URL.
-
.search(q, options = {}) ⇒ Topsy::Page
Returns list of results for a query.
-
.search_count(q) ⇒ Topsy::SearchCounts
Returns count of results for a search query.
-
.search_histogram(query, count_method = "target", slice = 86400, period = 30) ⇒ Topsy::SearchHistogram
Returns data on the volume of tweets.
-
.stats(url, options = {}) ⇒ Topsy::Stats
Returns counts of tweets for a URL.
-
.tags(url, options = {}) ⇒ Topsy::Page
Returns list of tags for a URL.
-
.trackbacks(url, options = {}) ⇒ Topsy::Page
Returns list of tweets (trackbacks) that mention the query URL, most recent first.
-
.trending(options = {}) ⇒ Topsy::Page
Returns list of trending terms.
-
.url_info(url) ⇒ Topsy::UrlInfo
Returns info about a URL.
Class Method Details
.author_info(url) ⇒ Topsy::Author
Returns profile information for an author (a twitter profile indexed by Topsy). The response contains the name, description (biography) and the influence level of the author
31 32 33 |
# File 'lib/topsy.rb', line 31 def self.(url) Topsy::Client.new.(url) end |
.credit ⇒ Topsy::RateLimitInfo
Returns info about API rate limiting
181 182 183 |
# File 'lib/topsy.rb', line 181 def self.credit Topsy::Client.new.credit end |
.experts(q, options = {}) ⇒ Topsy::Page
Returns list of authors that talk about the query. The list is sorted by frequency of posts and the influence of authors.
44 45 46 47 |
# File 'lib/topsy.rb', line 44 def self.experts(q, ={}) result = Topsy::Client.new.experts(q, ) Topsy::Page.new(result, Topsy::Author) end |
.link_post_count(url, options = {}) ⇒ Topsy::LinkpostCount
Returns count of links posted by an author. This is the efficient, count-only version of /linkposts
67 68 69 70 |
# File 'lib/topsy.rb', line 67 def self.link_post_count(url, ={}) response = Topsy::Client.new.link_post_count(url, ) Topsy::LinkpostCount.new(response) end |
.link_posts(url, options = {}) ⇒ Topsy::Page
Returns list of URLs posted by an author
57 58 59 |
# File 'lib/topsy.rb', line 57 def self.link_posts(url, ={}) Topsy::Client.new.link_posts(url, ) end |
.profile_search(q, options = {}) ⇒ Topsy::Page
Returns list list of author profiles that match the query. The query is matched against the nick, name and biography information and the results are sorted by closeness of match and the influence of authors.
79 80 81 |
# File 'lib/topsy.rb', line 79 def self.profile_search(q, ={}) Topsy::Client.new.profile_search(q, ) end |
.rate_limit ⇒ Object
186 187 188 189 |
# File 'lib/topsy.rb', line 186 def self.rate_limit self.credit if @rate_limit_info.nil? @rate_limit_info end |
.rate_limit=(info) ⇒ Object
191 192 193 |
# File 'lib/topsy.rb', line 191 def self.rate_limit=(info) @rate_limit_info = Topsy::RateLimitInfo.new(info) end |
.related(url, options = {}) ⇒ Topsy::Page
Returns list of URLs related to a given URL
90 91 92 |
# File 'lib/topsy.rb', line 90 def self.(url, ={}) Topsy::Client.new.(url, ) end |
.search(q, options = {}) ⇒ Topsy::Page
Returns list of results for a query.
102 103 104 |
# File 'lib/topsy.rb', line 102 def self.search(q, ={}) Topsy::Client.new.search(q, ) end |
.search_count(q) ⇒ Topsy::SearchCounts
Returns count of results for a search query.
110 111 112 |
# File 'lib/topsy.rb', line 110 def self.search_count(q) Topsy::Client.new.search_count(q) end |
.search_histogram(query, count_method = "target", slice = 86400, period = 30) ⇒ Topsy::SearchHistogram
Returns data on the volume of tweets
121 122 123 |
# File 'lib/topsy.rb', line 121 def self.search_histogram( query , count_method = "target" , slice = 86400 , period = 30 ) Topsy::Client.new.search_histogram( query , count_method , slice , period ) end |
.stats(url, options = {}) ⇒ Topsy::Stats
Returns counts of tweets for a URL
131 132 133 |
# File 'lib/topsy.rb', line 131 def self.stats(url, ={}) Topsy::Client.new.stats(url, ) end |
.tags(url, options = {}) ⇒ Topsy::Page
Returns list of tags for a URL.
142 143 144 |
# File 'lib/topsy.rb', line 142 def self.(url, ={}) Topsy::Client.new.(url, ) end |
.trackbacks(url, options = {}) ⇒ Topsy::Page
Returns list of tweets (trackbacks) that mention the query URL, most recent first.
155 156 157 |
# File 'lib/topsy.rb', line 155 def self.trackbacks(url, ={}) Topsy::Client.new.trackbacks(url, ) end |
.trending(options = {}) ⇒ Topsy::Page
Returns list of trending terms
166 167 168 |
# File 'lib/topsy.rb', line 166 def self.trending(={}) Topsy::Client.new.trending() end |
.url_info(url) ⇒ Topsy::UrlInfo
Returns info about a URL
174 175 176 |
# File 'lib/topsy.rb', line 174 def self.url_info(url) Topsy::Client.new.url_info(url) end |