topsy 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +2 -0
- data/README.markdown +3 -0
- data/Rakefile +8 -0
- data/TODO +1 -3
- data/VERSION +1 -1
- data/changelog.markdown +13 -2
- data/lib/topsy.rb +15 -15
- data/lib/topsy/client.rb +18 -8
- data/lib/topsy/linkpost.rb +10 -11
- data/lib/topsy/page.rb +12 -1
- data/test/fixtures/authorsearch-page2.json +115 -0
- data/test/fixtures/linkposts-page2.json +75 -0
- data/test/fixtures/search.json +1 -1
- data/test/test_topsy.rb +58 -18
- data/topsy.gemspec +5 -96
- metadata +4 -95
- data/.yardoc/checksums +0 -14
- data/.yardoc/objects/Topsy.dat +0 -0
- data/.yardoc/objects/Topsy/Author.dat +0 -0
- data/.yardoc/objects/Topsy/Author/to_s_i.dat +0 -0
- data/.yardoc/objects/Topsy/Author/type_i.dat +0 -0
- data/.yardoc/objects/Topsy/Client.dat +0 -0
- data/.yardoc/objects/Topsy/Client/author_info_i.dat +0 -0
- data/.yardoc/objects/Topsy/Client/author_search_i.dat +0 -0
- data/.yardoc/objects/Topsy/Client/credit_i.dat +0 -0
- data/.yardoc/objects/Topsy/Client/get_rate_limit_status_i.dat +0 -0
- data/.yardoc/objects/Topsy/Client/handle_response_i.dat +0 -0
- data/.yardoc/objects/Topsy/Client/link_post_count_i.dat +0 -0
- data/.yardoc/objects/Topsy/Client/link_posts_i.dat +0 -0
- data/.yardoc/objects/Topsy/Client/mashup_i.dat +0 -0
- data/.yardoc/objects/Topsy/Client/profile_search_i.dat +0 -0
- data/.yardoc/objects/Topsy/Client/raise_errors_i.dat +0 -0
- data/.yardoc/objects/Topsy/Client/related_i.dat +0 -0
- data/.yardoc/objects/Topsy/Client/search_count_i.dat +0 -0
- data/.yardoc/objects/Topsy/Client/search_i.dat +0 -0
- data/.yardoc/objects/Topsy/Client/stats_i.dat +0 -0
- data/.yardoc/objects/Topsy/Client/tags_i.dat +0 -0
- data/.yardoc/objects/Topsy/Client/trackbacks_i.dat +0 -0
- data/.yardoc/objects/Topsy/Client/trending_i.dat +0 -0
- data/.yardoc/objects/Topsy/Client/url_info_i.dat +0 -0
- data/.yardoc/objects/Topsy/LinkSearchResult.dat +0 -0
- data/.yardoc/objects/Topsy/LinkSearchResult/to_s_i.dat +0 -0
- data/.yardoc/objects/Topsy/Linkpost.dat +0 -0
- data/.yardoc/objects/Topsy/Linkpost/target_3D_i.dat +0 -0
- data/.yardoc/objects/Topsy/Linkpost/to_s_i.dat +0 -0
- data/.yardoc/objects/Topsy/LinkpostCount.dat +0 -0
- data/.yardoc/objects/Topsy/LinkpostCount/to_s_i.dat +0 -0
- data/.yardoc/objects/Topsy/Page.dat +0 -0
- data/.yardoc/objects/Topsy/Page/initialize_i.dat +0 -0
- data/.yardoc/objects/Topsy/Page/list_3D_i.dat +0 -0
- data/.yardoc/objects/Topsy/Page/to_s_i.dat +0 -0
- data/.yardoc/objects/Topsy/RateLimitInfo.dat +0 -0
- data/.yardoc/objects/Topsy/RateLimitInfo/refresh_in_seconds_i.dat +0 -0
- data/.yardoc/objects/Topsy/RateLimitInfo/reset_i.dat +0 -0
- data/.yardoc/objects/Topsy/SearchCounts.dat +0 -0
- data/.yardoc/objects/Topsy/SearchCounts/all_time_i.dat +0 -0
- data/.yardoc/objects/Topsy/SearchCounts/hour_i.dat +0 -0
- data/.yardoc/objects/Topsy/SearchCounts/month_i.dat +0 -0
- data/.yardoc/objects/Topsy/SearchCounts/overall_i.dat +0 -0
- data/.yardoc/objects/Topsy/SearchCounts/this_hour_i.dat +0 -0
- data/.yardoc/objects/Topsy/SearchCounts/this_month_i.dat +0 -0
- data/.yardoc/objects/Topsy/SearchCounts/this_week_i.dat +0 -0
- data/.yardoc/objects/Topsy/SearchCounts/today_i.dat +0 -0
- data/.yardoc/objects/Topsy/SearchCounts/week_i.dat +0 -0
- data/.yardoc/objects/Topsy/Stats.dat +0 -0
- data/.yardoc/objects/Topsy/Stats/to_s_i.dat +0 -0
- data/.yardoc/objects/Topsy/Tag.dat +0 -0
- data/.yardoc/objects/Topsy/Tag/to_s_i.dat +0 -0
- data/.yardoc/objects/Topsy/Target.dat +0 -0
- data/.yardoc/objects/Topsy/Target/to_s_i.dat +0 -0
- data/.yardoc/objects/Topsy/Trend.dat +0 -0
- data/.yardoc/objects/Topsy/Trend/to_s_i.dat +0 -0
- data/.yardoc/objects/Topsy/Tweet.dat +0 -0
- data/.yardoc/objects/Topsy/Tweet/author_3D_i.dat +0 -0
- data/.yardoc/objects/Topsy/Tweet/target_3D_i.dat +0 -0
- data/.yardoc/objects/Topsy/Tweet/to_s_i.dat +0 -0
- data/.yardoc/objects/Topsy/UrlInfo.dat +0 -0
- data/.yardoc/objects/Topsy/UrlInfo/to_s_i.dat +0 -0
- data/.yardoc/objects/root.dat +0 -0
- data/.yardoc/proxy_types +0 -0
- data/doc/Topsy.html +0 -112
- data/doc/Topsy/Author.html +0 -201
- data/doc/Topsy/Client.html +0 -2096
- data/doc/Topsy/LinkSearchResult.html +0 -152
- data/doc/Topsy/Linkpost.html +0 -209
- data/doc/Topsy/LinkpostCount.html +0 -152
- data/doc/Topsy/Page.html +0 -284
- data/doc/Topsy/RateLimitInfo.html +0 -201
- data/doc/Topsy/SearchCounts.html +0 -91
- data/doc/Topsy/Stats.html +0 -152
- data/doc/Topsy/Tag.html +0 -152
- data/doc/Topsy/Target.html +0 -152
- data/doc/Topsy/Trend.html +0 -152
- data/doc/Topsy/Tweet.html +0 -266
- data/doc/Topsy/UrlInfo.html +0 -152
- data/doc/_index.html +0 -245
- data/doc/class_list.html +0 -177
- data/doc/css/common.css +0 -1
- data/doc/css/full_list.css +0 -23
- data/doc/css/style.css +0 -263
- data/doc/file.README.html +0 -151
- data/doc/file_list.html +0 -29
- data/doc/index.html +0 -151
- data/doc/js/app.js +0 -91
- data/doc/js/full_list.js +0 -39
- data/doc/js/jquery.js +0 -19
- data/doc/method_list.html +0 -352
- data/doc/top-level-namespace.html +0 -79
data/.gitignore
CHANGED
data/README.markdown
CHANGED
|
@@ -11,6 +11,9 @@ Topsy is hosted on Gemcutter, so:
|
|
|
11
11
|
sudo gem install topsy
|
|
12
12
|
|
|
13
13
|
## Usage
|
|
14
|
+
>> Topsy.rate_limit
|
|
15
|
+
=> <#Topsy::RateLimitInfo limit=10000 remaining=10000 reset=1262804400>
|
|
16
|
+
|
|
14
17
|
>> Topsy.author_info('http://twitter.com/barackobama')
|
|
15
18
|
=> <#Topsy::Author description="44th President of the United States" influence_level=10 name="Barack Obama" nick="barackobama" topsy_author_url="http://topsy.com/twitter/barackobama" type="twitter" url="http://twitter.com/barackobama">
|
|
16
19
|
|
data/Rakefile
CHANGED
|
@@ -48,3 +48,11 @@ task :test => :check_dependencies
|
|
|
48
48
|
|
|
49
49
|
task :default => :test
|
|
50
50
|
|
|
51
|
+
begin
|
|
52
|
+
require 'yard'
|
|
53
|
+
YARD::Rake::YardocTask.new
|
|
54
|
+
rescue LoadError
|
|
55
|
+
task :yardoc do
|
|
56
|
+
abort "YARD is not available. In order to run yardoc, you must: sudo gem install yard"
|
|
57
|
+
end
|
|
58
|
+
end
|
data/TODO
CHANGED
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.2.
|
|
1
|
+
0.2.1
|
data/changelog.markdown
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
### 0.2.1 February, 14, 2010
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
* Added site: option to search method
|
|
6
|
+
|
|
7
|
+
Topsy.search('riak', :site => 'thechangelog.com')
|
|
8
|
+
|
|
9
|
+
### 0.2.0 January 6, 2010
|
|
10
|
+
|
|
11
|
+
* Ernesto implemented biz objects for all return types, thanks!
|
|
12
|
+
* Added rate_limit info
|
|
13
|
+
|
|
14
|
+
### 0.1.0 January 1, 2010
|
|
15
|
+
|
|
16
|
+
* Initial version
|
data/lib/topsy.rb
CHANGED
|
@@ -32,7 +32,7 @@ module Topsy
|
|
|
32
32
|
# 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
|
|
33
33
|
#
|
|
34
34
|
# @param [String] url URL string for the author.
|
|
35
|
-
# @return [
|
|
35
|
+
# @return [Topsy::Author]
|
|
36
36
|
def self.author_info(url)
|
|
37
37
|
Topsy::Client.new.author_info(url)
|
|
38
38
|
end
|
|
@@ -42,7 +42,7 @@ module Topsy
|
|
|
42
42
|
#
|
|
43
43
|
# @param [String] q the search query string
|
|
44
44
|
# @param [Hash] options method options
|
|
45
|
-
# @option options [
|
|
45
|
+
# @option options [Symbol] :window Time window for results. (default: :auto) Options: :auto - automatically pick the most recent and relevant window. :hour last hour, :day last day, :week last week, :month last month, :all all time
|
|
46
46
|
# @option options [Integer] :page page number of the result set. (default: 1, max: 10)
|
|
47
47
|
# @option options [Integer] :perpage limit number of results per page. (default: 10, max: 50)
|
|
48
48
|
# @return [Topsy::Page]
|
|
@@ -58,9 +58,9 @@ module Topsy
|
|
|
58
58
|
# @option options [String] :contains Query string to filter results
|
|
59
59
|
# @option options [Integer] :page page number of the result set. (default: 1, max: 10)
|
|
60
60
|
# @option options [Integer] :perpage limit number of results per page. (default: 10, max: 50)
|
|
61
|
-
# @return [
|
|
61
|
+
# @return [Topsy::Page]
|
|
62
62
|
def self.link_posts(url, options={})
|
|
63
|
-
Topsy::Client.new.link_posts(url, options
|
|
63
|
+
Topsy::Client.new.link_posts(url, options)
|
|
64
64
|
end
|
|
65
65
|
|
|
66
66
|
# Returns count of links posted by an author. This is the efficient, count-only version of /linkposts
|
|
@@ -70,7 +70,7 @@ module Topsy
|
|
|
70
70
|
# @option options [String] :contains Query string to filter results
|
|
71
71
|
# @return [Topsy::LinkpostCount]
|
|
72
72
|
def self.link_post_count(url, options={})
|
|
73
|
-
response = Topsy::Client.new.link_post_count(url, options
|
|
73
|
+
response = Topsy::Client.new.link_post_count(url, options)
|
|
74
74
|
Topsy::LinkpostCount.new(response)
|
|
75
75
|
end
|
|
76
76
|
|
|
@@ -80,7 +80,7 @@ module Topsy
|
|
|
80
80
|
# @param [Hash] options method options
|
|
81
81
|
# @option options [Integer] :page page number of the result set. (default: 1, max: 10)
|
|
82
82
|
# @option options [Integer] :perpage limit number of results per page. (default: 10, max: 50)
|
|
83
|
-
# @return [
|
|
83
|
+
# @return [Topsy::Page]
|
|
84
84
|
def self.profile_search(q, options={})
|
|
85
85
|
Topsy::Client.new.profile_search(q, options)
|
|
86
86
|
end
|
|
@@ -91,7 +91,7 @@ module Topsy
|
|
|
91
91
|
# @param [Hash] options method options
|
|
92
92
|
# @option options [Integer] :page page number of the result set. (default: 1, max: 10)
|
|
93
93
|
# @option options [Integer] :perpage limit number of results per page. (default: 10, max: 50)
|
|
94
|
-
# @return [
|
|
94
|
+
# @return [Topsy::Page]
|
|
95
95
|
def self.related(url, options={})
|
|
96
96
|
Topsy::Client.new.related(url, options)
|
|
97
97
|
end
|
|
@@ -100,10 +100,10 @@ module Topsy
|
|
|
100
100
|
#
|
|
101
101
|
# @param [String] q the search query string
|
|
102
102
|
# @param [Hash] options method options
|
|
103
|
-
# @option options [
|
|
103
|
+
# @option options [Symbol] :window Time window for results. (default: :auto) Options: :auto - automatically pick the most recent and relevant window. :hour last hour, :day last day, :week last week, :month last month, :all all time
|
|
104
104
|
# @option options [Integer] :page page number of the result set. (default: 1, max: 10)
|
|
105
105
|
# @option options [Integer] :perpage limit number of results per page. (default: 10, max: 50)
|
|
106
|
-
# @return [
|
|
106
|
+
# @return [Topsy::Page]
|
|
107
107
|
def self.search(q, options={})
|
|
108
108
|
Topsy::Client.new.search(q, options)
|
|
109
109
|
end
|
|
@@ -121,7 +121,7 @@ module Topsy
|
|
|
121
121
|
# @param [String] url the url to look up
|
|
122
122
|
# @param [Hash] options method options
|
|
123
123
|
# @option options [String] :contains Query string to filter results
|
|
124
|
-
# @return [
|
|
124
|
+
# @return [Topsy::Stats]
|
|
125
125
|
def self.stats(url, options={})
|
|
126
126
|
Topsy::Client.new.stats(url, options)
|
|
127
127
|
end
|
|
@@ -132,7 +132,7 @@ module Topsy
|
|
|
132
132
|
# @param [Hash] options method options
|
|
133
133
|
# @option options [Integer] :page page number of the result set. (default: 1, max: 10)
|
|
134
134
|
# @option options [Integer] :perpage limit number of results per page. (default: 10, max: 50)
|
|
135
|
-
# @return [
|
|
135
|
+
# @return [Topsy::Page]
|
|
136
136
|
def self.tags(url, options={})
|
|
137
137
|
Topsy::Client.new.tags(url, options)
|
|
138
138
|
end
|
|
@@ -145,7 +145,7 @@ module Topsy
|
|
|
145
145
|
# @option options [Boolean] :infonly filters trackbacks to influential only (default 0)
|
|
146
146
|
# @option options [Integer] :page page number of the result set. (default: 1, max: 10)
|
|
147
147
|
# @option options [Integer] :perpage limit number of results per page. (default: 10, max: 50)
|
|
148
|
-
# @return [
|
|
148
|
+
# @return [Topsy::Page]
|
|
149
149
|
def self.trackbacks(url, options={})
|
|
150
150
|
Topsy::Client.new.trackbacks(url, options)
|
|
151
151
|
end
|
|
@@ -156,7 +156,7 @@ module Topsy
|
|
|
156
156
|
# @param [Hash] options method options
|
|
157
157
|
# @option options [Integer] :page page number of the result set. (default: 1, max: 10)
|
|
158
158
|
# @option options [Integer] :perpage limit number of results per page. (default: 10, max: 50)
|
|
159
|
-
# @return [
|
|
159
|
+
# @return [Topsy::Page]
|
|
160
160
|
def self.trending(options={})
|
|
161
161
|
Topsy::Client.new.trending(options)
|
|
162
162
|
end
|
|
@@ -164,14 +164,14 @@ module Topsy
|
|
|
164
164
|
# Returns info about a URL
|
|
165
165
|
#
|
|
166
166
|
# @param [String] url the url to look up
|
|
167
|
-
# @return [
|
|
167
|
+
# @return [Topsy::UrlInfo]
|
|
168
168
|
def self.url_info(url)
|
|
169
169
|
Topsy::Client.new.url_info(url)
|
|
170
170
|
end
|
|
171
171
|
|
|
172
172
|
# Returns info about API rate limiting
|
|
173
173
|
#
|
|
174
|
-
# @return [RateLimitInfo]
|
|
174
|
+
# @return [Topsy::RateLimitInfo]
|
|
175
175
|
def self.credit
|
|
176
176
|
Topsy::Client.new.credit
|
|
177
177
|
end
|
data/lib/topsy/client.rb
CHANGED
|
@@ -3,10 +3,11 @@ module Topsy
|
|
|
3
3
|
include HTTParty
|
|
4
4
|
format :json
|
|
5
5
|
base_uri "http://otter.topsy.com"
|
|
6
|
+
@@windows = {:all => 'a', :auto => 'auto', :week => 'w', :day => 'd', :month => 'm', :hour => 'h'}
|
|
6
7
|
|
|
7
8
|
# Returns info about API rate limiting
|
|
8
9
|
#
|
|
9
|
-
# @return [RateLimitInfo]
|
|
10
|
+
# @return [Topsy::RateLimitInfo]
|
|
10
11
|
def credit
|
|
11
12
|
handle_response(self.class.get("/credit.json"))
|
|
12
13
|
end
|
|
@@ -24,11 +25,12 @@ module Topsy
|
|
|
24
25
|
#
|
|
25
26
|
# @param [String] q the search query string
|
|
26
27
|
# @param [Hash] options method options
|
|
27
|
-
# @option options [
|
|
28
|
+
# @option options [Symbol] :window Time window for results. (default: :auto) Options: :auto - automatically pick the most recent and relevant window. :hour last hour, :day last day, :week last week, :month last month, :all all time
|
|
28
29
|
# @option options [Integer] :page page number of the result set. (default: 1, max: 10)
|
|
29
30
|
# @option options [Integer] :perpage limit number of results per page. (default: 10, max: 50)
|
|
30
31
|
# @return [Hashie::Mash]
|
|
31
32
|
def author_search(q, options={})
|
|
33
|
+
options[:window] = @@windows[options[:window]] if options[:window]
|
|
32
34
|
handle_response(self.class.get("/authorsearch.json", :query => {:q => q}.merge(options)))
|
|
33
35
|
end
|
|
34
36
|
|
|
@@ -41,9 +43,7 @@ module Topsy
|
|
|
41
43
|
# @option options [Integer] :perpage limit number of results per page. (default: 10, max: 50)
|
|
42
44
|
# @return [Topsy::Page]
|
|
43
45
|
def link_posts(url, options={})
|
|
44
|
-
|
|
45
|
-
query.merge!(options)
|
|
46
|
-
linkposts = handle_response(self.class.get("/linkposts.json", :query => query))
|
|
46
|
+
linkposts = handle_response(self.class.get("/linkposts.json", :query => {:url => url}.merge(options)))
|
|
47
47
|
Topsy::Page.new(linkposts,Topsy::Linkpost)
|
|
48
48
|
end
|
|
49
49
|
|
|
@@ -58,7 +58,9 @@ module Topsy
|
|
|
58
58
|
Topsy::LinkpostCount.new(count)
|
|
59
59
|
end
|
|
60
60
|
|
|
61
|
-
# Returns list list of author profiles that match the query.
|
|
61
|
+
# Returns list list of author profiles that match the query.
|
|
62
|
+
# The query is matched against the nick, name and biography
|
|
63
|
+
# information and the results are sorted by closeness of match and the influence of authors.
|
|
62
64
|
#
|
|
63
65
|
# @param [String] q the search query string
|
|
64
66
|
# @param [Hash] options method options
|
|
@@ -86,11 +88,19 @@ module Topsy
|
|
|
86
88
|
#
|
|
87
89
|
# @param [String] q the search query string
|
|
88
90
|
# @param [Hash] options method options
|
|
89
|
-
# @option options [
|
|
91
|
+
# @option options [Symbol] :window Time window for results. (default: :auto) Options: :auto - automatically pick the most recent and relevant window. :hour last hour, :day last day, :week last week, :month last month, :all all time
|
|
90
92
|
# @option options [Integer] :page page number of the result set. (default: 1, max: 10)
|
|
91
93
|
# @option options [Integer] :perpage limit number of results per page. (default: 10, max: 50)
|
|
94
|
+
# @option options [String] :site narrow results to a domain
|
|
92
95
|
# @return [Topsy::Page]
|
|
93
96
|
def search(q, options={})
|
|
97
|
+
if q.is_a?(Hash)
|
|
98
|
+
options = q
|
|
99
|
+
q = "site:#{options.delete(:site)}" if options[:site]
|
|
100
|
+
else
|
|
101
|
+
q += " site:#{options.delete(:site)}" if options[:site]
|
|
102
|
+
end
|
|
103
|
+
options[:window] = @@windows[options[:window]] if options[:window]
|
|
94
104
|
results = handle_response(self.class.get("/search.json", :query => {:q => q}.merge(options)))
|
|
95
105
|
Topsy::Page.new(results,Topsy::LinkSearchResult)
|
|
96
106
|
end
|
|
@@ -151,7 +161,7 @@ module Topsy
|
|
|
151
161
|
# @param [Hash] options method options
|
|
152
162
|
# @option options [Integer] :page page number of the result set. (default: 1, max: 10)
|
|
153
163
|
# @option options [Integer] :perpage limit number of results per page. (default: 10, max: 50)
|
|
154
|
-
# @return [
|
|
164
|
+
# @return [Topsy::Page]
|
|
155
165
|
def trending(options={})
|
|
156
166
|
response = handle_response(self.class.get("/trending.json", :query => options))
|
|
157
167
|
Topsy::Page.new(response,Topsy::Trend)
|
data/lib/topsy/linkpost.rb
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
# A Linkpost has the following attributes:
|
|
3
|
-
# "permalink_url" : "http://twitter.com/barackobama/status/3569838653",
|
|
4
|
-
# "target" : target instance
|
|
5
|
-
# "date" : "1251337427",
|
|
6
|
-
# "content" : "Highlights from the tribute to Sen. Kennedy's life and
|
|
7
|
-
# accomplishments from last year's Democratic National Convention: http://bit.ly/TJcyr",
|
|
8
|
-
# "date_alpha" : "3 hours ago"
|
|
9
|
-
# According to the official Topsy doc: http://code.google.com/p/otterapi/wiki/Resources?tm=6#/linkposts
|
|
10
|
-
#
|
|
1
|
+
|
|
11
2
|
module Topsy
|
|
12
|
-
|
|
3
|
+
# This is the linkpost class for the topsy library.
|
|
4
|
+
# A Linkpost has the following attributes:
|
|
5
|
+
# "permalink_url" : "http://twitter.com/barackobama/status/3569838653",
|
|
6
|
+
# "target" : target instance
|
|
7
|
+
# "date" : "1251337427",
|
|
8
|
+
# "content" : "Highlights from the tribute to Sen. Kennedy's life and
|
|
9
|
+
# accomplishments from last year's Democratic National Convention: http://bit.ly/TJcyr",
|
|
10
|
+
# "date_alpha" : "3 hours ago"
|
|
11
|
+
# According to the official Topsy doc: http://code.google.com/p/otterapi/wiki/Resources?tm=6#/linkposts
|
|
13
12
|
class Linkpost < Hashie::Dash
|
|
14
13
|
property :permalink_url
|
|
15
14
|
property :target
|
data/lib/topsy/page.rb
CHANGED
|
@@ -3,7 +3,9 @@
|
|
|
3
3
|
# "page" : 1,
|
|
4
4
|
# "total" : "1139",
|
|
5
5
|
# "perpage" : 15,
|
|
6
|
-
# "list" : Array of Author instances
|
|
6
|
+
# "list" : Array of Author instances
|
|
7
|
+
# "window" : Optional symbol
|
|
8
|
+
# "topsy_trackback_url" : String, optional
|
|
7
9
|
#
|
|
8
10
|
# According to the official Topsy doc: http://code.google.com/p/otterapi/wiki/Resources?tm=6#/authorsearch
|
|
9
11
|
#
|
|
@@ -17,6 +19,8 @@ module Topsy
|
|
|
17
19
|
property :window
|
|
18
20
|
property :topsy_trackback_url
|
|
19
21
|
|
|
22
|
+
@@windows = {'a' => :all, 'auto' => :auto, 'w' => :week, 'd' => :day, 'm' => :month, 'h' => :hour}
|
|
23
|
+
|
|
20
24
|
def to_s
|
|
21
25
|
"Topsy Page: #{page} of #{total}, #{list.size} authors"
|
|
22
26
|
end
|
|
@@ -35,6 +39,13 @@ module Topsy
|
|
|
35
39
|
self[:list] = value
|
|
36
40
|
end
|
|
37
41
|
end
|
|
42
|
+
|
|
43
|
+
def window=(value)
|
|
44
|
+
if value
|
|
45
|
+
self[:window] = @@windows[value]
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
|
|
38
49
|
end
|
|
39
50
|
|
|
40
51
|
end
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
{
|
|
2
|
+
"request": {
|
|
3
|
+
"response_type": "json",
|
|
4
|
+
"resource": "authorsearch",
|
|
5
|
+
"parameters": {
|
|
6
|
+
"q": "pengwynn"
|
|
7
|
+
},
|
|
8
|
+
"url": "http://button.topsy.com/authorsearch.json?q=pengwynn"
|
|
9
|
+
},
|
|
10
|
+
"response": {
|
|
11
|
+
"page": 2,
|
|
12
|
+
"total": 512,
|
|
13
|
+
"perpage": 10,
|
|
14
|
+
"list": [{
|
|
15
|
+
"name": "Bradley Joyce",
|
|
16
|
+
"nick": "bradleyjoyce",
|
|
17
|
+
"photo_url": "http://a3.twimg.com/profile_images/421303551/bradley_normal.png",
|
|
18
|
+
"description": "Entrepreneur and Web Developer -- TweetAbout.com, TickStart.com, TweetCongress.org, Floxee.org, Sherflock.com, Squeejee.com",
|
|
19
|
+
"influence_level": "7",
|
|
20
|
+
"hits": 47,
|
|
21
|
+
"url": "http://twitter.com/bradleyjoyce",
|
|
22
|
+
"topsy_author_url": "http://topsy.com/twitter/bradleyjoyce"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"name": "tweetcongress",
|
|
26
|
+
"nick": "tweetcongress",
|
|
27
|
+
"photo_url": "http://s.twimg.com/a/1253209888/images/default_profile_0_normal.png",
|
|
28
|
+
"description": "Grassroots effort to get Congress tweeting!",
|
|
29
|
+
"influence_level": "10",
|
|
30
|
+
"hits": 13,
|
|
31
|
+
"url": "http://twitter.com/tweetcongress",
|
|
32
|
+
"topsy_author_url": "http://topsy.com/twitter/tweetcongress"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"name": "Jim Mulholland",
|
|
36
|
+
"nick": "mully",
|
|
37
|
+
"photo_url": "http://a3.twimg.com/profile_images/385459831/twitterProfilePhoto_normal.jpg",
|
|
38
|
+
"description": "Partner at Squeejee, a Ruby / Rails consultancy; Co-Creator of TweetCongress; Husband and father of 3; ",
|
|
39
|
+
"influence_level": "4",
|
|
40
|
+
"hits": 19,
|
|
41
|
+
"url": "http://twitter.com/mully",
|
|
42
|
+
"topsy_author_url": "http://topsy.com/twitter/mully"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"name": "Chris McCroskey",
|
|
46
|
+
"nick": "curvezilla",
|
|
47
|
+
"photo_url": "http://a1.twimg.com/profile_images/413047412/chrisheadshot_normal.jpg",
|
|
48
|
+
"description": "Mission Control at Squeejee and Co-Founder of TweetCongress.org & Founder of Heroes4Heroes a charity that sends care packets to the troops. Proud Razorback!",
|
|
49
|
+
"influence_level": "4",
|
|
50
|
+
"hits": 16,
|
|
51
|
+
"url": "http://twitter.com/curvezilla",
|
|
52
|
+
"topsy_author_url": "http://topsy.com/twitter/curvezilla"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"name": "Steve Lunceford",
|
|
56
|
+
"nick": "dslunceford",
|
|
57
|
+
"photo_url": "http://a3.twimg.com/profile_images/420259957/headshot_tight_normal.JPG",
|
|
58
|
+
"description": "20-year media and PR pro focusing on Government; TiVo, Home Theater & general gadget fanatic. Creator of http://GovTwit.com",
|
|
59
|
+
"influence_level": "10",
|
|
60
|
+
"hits": 11,
|
|
61
|
+
"url": "http://twitter.com/dslunceford",
|
|
62
|
+
"topsy_author_url": "http://topsy.com/twitter/dslunceford"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"name": "Damon Clinkscales",
|
|
66
|
+
"nick": "damon",
|
|
67
|
+
"photo_url": "http://a1.twimg.com/profile_images/561257818/mo5_crop_normal.jpg",
|
|
68
|
+
"description": "I'm a shepherd. Software engineer at VitalSource and leader of Austin On Rails. I also build apps like http://snaptweet.com and http://doesfollow.com. ",
|
|
69
|
+
"influence_level": "10",
|
|
70
|
+
"hits": 8,
|
|
71
|
+
"url": "http://twitter.com/damon",
|
|
72
|
+
"topsy_author_url": "http://topsy.com/twitter/damon"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"name": "Wynn Netherland",
|
|
76
|
+
"nick": "pengwynn",
|
|
77
|
+
"photo_url": "http://a1.twimg.com/profile_images/485575482/komikazee_normal.png",
|
|
78
|
+
"description": "Christian husband and father, Ruby developer and web designer. Co-founder of TweetCongress.org and Squeejee, makers of Good clean fun!™",
|
|
79
|
+
"influence_level": "10",
|
|
80
|
+
"hits": 8,
|
|
81
|
+
"url": "http://twitter.com/pengwynn",
|
|
82
|
+
"topsy_author_url": "http://topsy.com/twitter/pengwynn"
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"name": "Luigi Montanez",
|
|
86
|
+
"nick": "luigimontanez",
|
|
87
|
+
"photo_url": "http://a3.twimg.com/profile_images/523899985/Comic_Book_normal.png",
|
|
88
|
+
"description": "Web App Developer at the Sunlight Labs",
|
|
89
|
+
"influence_level": "10",
|
|
90
|
+
"hits": 6,
|
|
91
|
+
"url": "http://twitter.com/luigimontanez",
|
|
92
|
+
"topsy_author_url": "http://topsy.com/twitter/luigimontanez"
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"name": "Locomotivation",
|
|
96
|
+
"nick": "locomotivation",
|
|
97
|
+
"photo_url": "http://a1.twimg.com/profile_images/386446850/twitterProfilePhoto_normal.jpg",
|
|
98
|
+
"description": "The code blog from the guys at Squeejee.",
|
|
99
|
+
"influence_level": "5",
|
|
100
|
+
"hits": 12,
|
|
101
|
+
"url": "http://twitter.com/locomotivation",
|
|
102
|
+
"topsy_author_url": "http://topsy.com/twitter/locomotivation"
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"name": "Adam Stacoviak",
|
|
106
|
+
"nick": "adamstac",
|
|
107
|
+
"photo_url": "http://a1.twimg.com/profile_images/493267610/twitterProfilePhoto_normal.jpg",
|
|
108
|
+
"description": "Co-founder of Handcrafted, co-producer of The Web 2.0 Show podcast, and a lover of beautiful UI/UX. You should follow me :)",
|
|
109
|
+
"influence_level": "3",
|
|
110
|
+
"hits": 11,
|
|
111
|
+
"url": "http://twitter.com/adamstac",
|
|
112
|
+
"topsy_author_url": "http://topsy.com/twitter/adamstac"
|
|
113
|
+
}]
|
|
114
|
+
}
|
|
115
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
{
|
|
2
|
+
"request": {
|
|
3
|
+
"response_type": "json",
|
|
4
|
+
"resource": "linkposts",
|
|
5
|
+
"parameters": {
|
|
6
|
+
"url": "http://twitter.com/pengwynn"
|
|
7
|
+
},
|
|
8
|
+
"url": "http://button.topsy.com/linkposts.json?url=http%3A%2F%2Ftwitter.com%2Fpengwynn"
|
|
9
|
+
},
|
|
10
|
+
"response": {
|
|
11
|
+
"page": 2,
|
|
12
|
+
"total": 987,
|
|
13
|
+
"perpage": 5,
|
|
14
|
+
"list": [{
|
|
15
|
+
"permalink_url": "http://twitter.com/pengwynn/status/7253938349",
|
|
16
|
+
"date": 1262307998,
|
|
17
|
+
"content": "For auld lang syne, my dear: http://en.wikipedia.org/wiki/Auld_Lang_Syne#Lyrics",
|
|
18
|
+
"date_alpha": "16 hours ago",
|
|
19
|
+
"target": {
|
|
20
|
+
"topsy_trackback_url": "http://topsy.com/trackback?url=http%3A%2F%2Fen.wikipedia.org%2Fwiki%2FAuld_Lang_Syne%23Lyrics",
|
|
21
|
+
"url": "http://en.wikipedia.org/wiki/Auld_Lang_Syne#Lyrics",
|
|
22
|
+
"title": "Auld Lang Syne - Wikipedia, the free encyclopedia",
|
|
23
|
+
"trackback_total": 8
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"permalink_url": "http://twitter.com/pengwynn/status/7212961312",
|
|
28
|
+
"date": 1262216148,
|
|
29
|
+
"content": "Treating the in-laws to some Texas BBQ — at Rudy's http://gowal.la/s/dVo",
|
|
30
|
+
"date_alpha": "2 days ago",
|
|
31
|
+
"target": {
|
|
32
|
+
"topsy_trackback_url": "http://topsy.com/tb/gowalla.com/spots/43464",
|
|
33
|
+
"url": "http://gowalla.com/spots/43464",
|
|
34
|
+
"title": "Rudy's on Gowalla",
|
|
35
|
+
"trackback_total": 2
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"permalink_url": "http://twitter.com/pengwynn/status/7167706422",
|
|
40
|
+
"date": 1262112340,
|
|
41
|
+
"content": "Catching a matinee of Sherlock Holmes — at Stagecoach Theater http://gowal.la/s/Grk",
|
|
42
|
+
"date_alpha": "3 days ago",
|
|
43
|
+
"target": {
|
|
44
|
+
"topsy_trackback_url": "http://topsy.com/tb/gowalla.com/spots/136029",
|
|
45
|
+
"url": "http://gowalla.com/spots/136029",
|
|
46
|
+
"title": "Stagecoach Theater on Gowalla",
|
|
47
|
+
"trackback_total": 1
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"permalink_url": "http://twitter.com/pengwynn/status/7162128190",
|
|
52
|
+
"date": 1262100992,
|
|
53
|
+
"content": "Learning about the Pacific War — at National Museum of The Pacific War http://gowal.la/s/575",
|
|
54
|
+
"date_alpha": "3 days ago",
|
|
55
|
+
"target": {
|
|
56
|
+
"topsy_trackback_url": "http://topsy.com/tb/gowalla.com/spots/13808",
|
|
57
|
+
"url": "http://gowalla.com/spots/13808",
|
|
58
|
+
"title": "National Museum of The Pacific War on Gowalla",
|
|
59
|
+
"trackback_total": 1
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"permalink_url": "http://twitter.com/pengwynn/status/7139983009",
|
|
64
|
+
"date": 1262045378,
|
|
65
|
+
"content": "Rails Magazine #5 is out http://ow.ly/QuFY /via @rupakg",
|
|
66
|
+
"date_alpha": "4 days ago",
|
|
67
|
+
"target": {
|
|
68
|
+
"topsy_trackback_url": "http://topsy.com/tb/www.railsmagazine.com/issues/5",
|
|
69
|
+
"url": "http://www.railsmagazine.com/issues/5",
|
|
70
|
+
"title": "Issue #5: Winter Jam",
|
|
71
|
+
"trackback_total": 13
|
|
72
|
+
}
|
|
73
|
+
}]
|
|
74
|
+
}
|
|
75
|
+
}
|