t 0.9.7 → 0.9.8
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/t.rb +1 -1
- data/lib/t/authorizable.rb +10 -2
- data/lib/t/cli.rb +92 -28
- data/lib/t/collectable.rb +7 -4
- data/lib/t/delete.rb +13 -6
- data/lib/t/format_helpers.rb +44 -44
- data/lib/t/list.rb +22 -14
- data/lib/t/printable.rb +156 -145
- data/lib/t/rcfile.rb +2 -1
- data/lib/t/requestable.rb +21 -21
- data/lib/t/search.rb +12 -8
- data/lib/t/set.rb +3 -3
- data/lib/t/stream.rb +13 -5
- data/lib/t/version.rb +1 -1
- data/spec/cli_spec.rb +190 -78
- data/spec/fixtures/search.json +111 -1
- data/spec/fixtures/statuses.json +180 -0
- data/spec/format_helpers_spec.rb +96 -0
- data/spec/list_spec.rb +24 -5
- data/spec/search_spec.rb +23 -3
- metadata +4 -2
data/lib/t/rcfile.rb
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
require 'singleton'
|
2
|
-
require 'yaml'
|
3
2
|
|
4
3
|
class RCFile
|
5
4
|
FILE_NAME = '.trc'
|
@@ -60,6 +59,7 @@ class RCFile
|
|
60
59
|
end
|
61
60
|
|
62
61
|
def load
|
62
|
+
require 'yaml'
|
63
63
|
YAML.load_file(@path)
|
64
64
|
rescue Errno::ENOENT
|
65
65
|
default_structure
|
@@ -86,6 +86,7 @@ private
|
|
86
86
|
end
|
87
87
|
|
88
88
|
def write
|
89
|
+
require 'yaml'
|
89
90
|
File.open(@path, File::RDWR|File::TRUNC|File::CREAT, 0600) do |rcfile|
|
90
91
|
rcfile.write @data.to_yaml
|
91
92
|
end
|
data/lib/t/requestable.rb
CHANGED
@@ -5,31 +5,31 @@ module T
|
|
5
5
|
DEFAULT_HOST = 'api.twitter.com'
|
6
6
|
DEFAULT_PROTOCOL = 'https'
|
7
7
|
|
8
|
-
|
8
|
+
private
|
9
9
|
|
10
|
-
|
11
|
-
|
12
|
-
|
10
|
+
def base_url
|
11
|
+
"#{protocol}://#{host}"
|
12
|
+
end
|
13
13
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
14
|
+
def client
|
15
|
+
return @client if @client
|
16
|
+
@rcfile.path = options['profile'] if options['profile']
|
17
|
+
@client = Twitter::Client.new(
|
18
|
+
:endpoint => base_url,
|
19
|
+
:consumer_key => @rcfile.active_consumer_key,
|
20
|
+
:consumer_secret => @rcfile.active_consumer_secret,
|
21
|
+
:oauth_token => @rcfile.active_token,
|
22
|
+
:oauth_token_secret => @rcfile.active_secret
|
23
|
+
)
|
24
|
+
end
|
25
25
|
|
26
|
-
|
27
|
-
|
28
|
-
|
26
|
+
def host
|
27
|
+
options['host'] || DEFAULT_HOST
|
28
|
+
end
|
29
29
|
|
30
|
-
|
31
|
-
|
32
|
-
|
30
|
+
def protocol
|
31
|
+
options['no-ssl'] ? 'http' : DEFAULT_PROTOCOL
|
32
|
+
end
|
33
33
|
|
34
34
|
end
|
35
35
|
end
|
data/lib/t/search.rb
CHANGED
@@ -1,14 +1,10 @@
|
|
1
|
-
require 'csv'
|
2
|
-
# 'fastercsv' required on Ruby versions < 1.9
|
3
|
-
require 'fastercsv' unless Array.new.respond_to?(:to_csv)
|
4
|
-
require 'htmlentities'
|
5
|
-
require 't/collectable'
|
6
|
-
require 't/printable'
|
7
|
-
require 't/rcfile'
|
8
|
-
require 't/requestable'
|
9
1
|
require 'thor'
|
10
2
|
|
11
3
|
module T
|
4
|
+
autoload :Collectable, 't/collectable'
|
5
|
+
autoload :Printable, 't/printable'
|
6
|
+
autoload :RCFile, 't/rcfile'
|
7
|
+
autoload :Requestable, 't/requestable'
|
12
8
|
class Search < Thor
|
13
9
|
include T::Collectable
|
14
10
|
include T::Printable
|
@@ -35,7 +31,10 @@ module T
|
|
35
31
|
statuses = collect_with_rpp(rpp) do |opts|
|
36
32
|
client.search(query, opts)
|
37
33
|
end
|
34
|
+
require 'htmlentities'
|
38
35
|
if options['csv']
|
36
|
+
require 'csv'
|
37
|
+
require 'fastercsv' unless Array.new.respond_to?(:to_csv)
|
39
38
|
say STATUS_HEADINGS.to_csv unless statuses.empty?
|
40
39
|
statuses.each do |status|
|
41
40
|
say [status.id, csv_formatted_time(status), status.from_user, HTMLEntities.new.decode(status.full_text)].to_csv
|
@@ -80,6 +79,7 @@ module T
|
|
80
79
|
list = owner
|
81
80
|
owner = @rcfile.active_profile[0]
|
82
81
|
else
|
82
|
+
require 't/core_ext/string'
|
83
83
|
owner = if options['id']
|
84
84
|
owner.to_i
|
85
85
|
else
|
@@ -138,6 +138,7 @@ module T
|
|
138
138
|
query = args.pop
|
139
139
|
user = args.pop
|
140
140
|
if user
|
141
|
+
require 't/core_ext/string'
|
141
142
|
user = if options['id']
|
142
143
|
user.to_i
|
143
144
|
else
|
@@ -172,6 +173,9 @@ module T
|
|
172
173
|
method_option "tweets", :aliases => "-t", :type => :boolean, :default => false, :desc => "Sort by number of Tweets."
|
173
174
|
method_option "unsorted", :aliases => "-u", :type => :boolean, :default => false, :desc => "Output is not sorted."
|
174
175
|
def users(query)
|
176
|
+
require 't/core_ext/enumerable'
|
177
|
+
require 'retryable'
|
178
|
+
require 'twitter'
|
175
179
|
users = 1.upto(50).threaded_map do |page|
|
176
180
|
retryable(:tries => 3, :on => Twitter::Error::ServerError, :sleep => 0) do
|
177
181
|
client.user_search(query, :page => page, :per_page => MAX_USERS_PER_REQUEST)
|
data/lib/t/set.rb
CHANGED
@@ -1,9 +1,8 @@
|
|
1
|
-
require 't/core_ext/string'
|
2
|
-
require 't/rcfile'
|
3
|
-
require 't/requestable'
|
4
1
|
require 'thor'
|
5
2
|
|
6
3
|
module T
|
4
|
+
autoload :RCFile, 't/rcfile'
|
5
|
+
autoload :Requestable, 't/requestable'
|
7
6
|
class Set < Thor
|
8
7
|
include T::Requestable
|
9
8
|
|
@@ -16,6 +15,7 @@ module T
|
|
16
15
|
|
17
16
|
desc "active SCREEN_NAME [CONSUMER_KEY]", "Set your active account."
|
18
17
|
def active(screen_name, consumer_key=nil)
|
18
|
+
require 't/core_ext/string'
|
19
19
|
screen_name = screen_name.strip_ats
|
20
20
|
@rcfile.path = options['profile'] if options['profile']
|
21
21
|
consumer_key = @rcfile[screen_name].keys.last if consumer_key.nil?
|
data/lib/t/stream.rb
CHANGED
@@ -1,11 +1,10 @@
|
|
1
|
-
require 't/cli'
|
2
|
-
require 't/printable'
|
3
|
-
require 't/rcfile'
|
4
|
-
require 't/search'
|
5
1
|
require 'thor'
|
6
|
-
require 'tweetstream'
|
7
2
|
|
8
3
|
module T
|
4
|
+
autoload :CLI, 't/cli'
|
5
|
+
autoload :Printable, 't/printable'
|
6
|
+
autoload :RCFile, 't/rcfile'
|
7
|
+
autoload :Search, 't/search'
|
9
8
|
class Stream < Thor
|
10
9
|
include T::Printable
|
11
10
|
|
@@ -25,8 +24,11 @@ module T
|
|
25
24
|
method_option "csv", :aliases => "-c", :type => :boolean, :default => false, :desc => "Output in CSV format."
|
26
25
|
method_option "long", :aliases => "-l", :type => :boolean, :default => false, :desc => "Output in long format."
|
27
26
|
def all
|
27
|
+
require 'tweetstream'
|
28
28
|
client.on_inited do
|
29
29
|
if options['csv']
|
30
|
+
require 'csv'
|
31
|
+
require 'fastercsv' unless Array.new.respond_to?(:to_csv)
|
30
32
|
say STATUS_HEADINGS.to_csv
|
31
33
|
elsif options['long'] && STDOUT.tty?
|
32
34
|
headings = STATUS_HEADINGS.size.times.map do |index|
|
@@ -52,6 +54,7 @@ module T
|
|
52
54
|
|
53
55
|
desc "matrix", "Unfortunately, no one can be told what the Matrix is. You have to see it for yourself."
|
54
56
|
def matrix
|
57
|
+
require 'tweetstream'
|
55
58
|
client.on_timeline_status do |status|
|
56
59
|
say(status.full_text.gsub("\n", ''), [:bold, :green, :on_black])
|
57
60
|
end
|
@@ -63,6 +66,7 @@ module T
|
|
63
66
|
method_option "long", :aliases => "-l", :type => :boolean, :default => false, :desc => "Output in long format."
|
64
67
|
def search(keyword, *keywords)
|
65
68
|
keywords.unshift(keyword)
|
69
|
+
require 'tweetstream'
|
66
70
|
client.on_inited do
|
67
71
|
search = T::Search.new
|
68
72
|
search.options = search.options.merge(options)
|
@@ -89,6 +93,7 @@ module T
|
|
89
93
|
method_option "csv", :aliases => "-c", :type => :boolean, :default => false, :desc => "Output in CSV format."
|
90
94
|
method_option "long", :aliases => "-l", :type => :boolean, :default => false, :desc => "Output in long format."
|
91
95
|
def timeline
|
96
|
+
require 'tweetstream'
|
92
97
|
client.on_inited do
|
93
98
|
cli = T::CLI.new
|
94
99
|
cli.options = cli.options.merge(options)
|
@@ -117,8 +122,11 @@ module T
|
|
117
122
|
def users(user_id, *user_ids)
|
118
123
|
user_ids.unshift(user_id)
|
119
124
|
user_ids.map!(&:to_i)
|
125
|
+
require 'tweetstream'
|
120
126
|
client.on_inited do
|
121
127
|
if options['csv']
|
128
|
+
require 'csv'
|
129
|
+
require 'fastercsv' unless Array.new.respond_to?(:to_csv)
|
122
130
|
say STATUS_HEADINGS.to_csv
|
123
131
|
elsif options['long'] && STDOUT.tty?
|
124
132
|
headings = STATUS_HEADINGS.size.times.map do |index|
|
data/lib/t/version.rb
CHANGED
data/spec/cli_spec.rb
CHANGED
@@ -113,6 +113,9 @@ testcli
|
|
113
113
|
stub_get("/1/direct_messages.json").
|
114
114
|
with(:query => {:count => "20"}).
|
115
115
|
to_return(:body => fixture("direct_messages.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
116
|
+
stub_get("/1/direct_messages.json").
|
117
|
+
with(:query => {:count => "10", "max_id"=>"1624782205"}).
|
118
|
+
to_return(:body => fixture("empty_array.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
116
119
|
end
|
117
120
|
it "should request the correct resource" do
|
118
121
|
@cli.direct_messages
|
@@ -123,16 +126,16 @@ testcli
|
|
123
126
|
it "should have the correct output" do
|
124
127
|
@cli.direct_messages
|
125
128
|
$stdout.string.should == <<-eos
|
126
|
-
sferik: Sounds good. Meeting Tuesday is fine. (
|
127
|
-
sferik: That's great news! Let's plan to chat around 8 AM tomorrow Pacific time. Does that work for you? (
|
128
|
-
sferik: I asked Yehuda about the stipend. I believe it has already been sent. Glad you're feeling better. (
|
129
|
-
sferik: Just checking in. How's everything going? (
|
130
|
-
sferik: Not sure about the payment. Feel free to ask Leah or Yehuda directly. Think you'll be able to finish up your work on graphs this weekend? (
|
131
|
-
sferik: How are the graph enhancements coming? (
|
132
|
-
sferik: How are the graphs coming? I'm really looking forward to seeing what you do with Raphaël. (
|
133
|
-
sferik: Awesome! Any luck duplicating the Gemfile.lock error with Ruby 1.9.2 final? (
|
134
|
-
sferik: I just committed a bunch of cleanup and fixes to RailsAdmin that touched many of files. Make sure you pull to avoid conflicts. (
|
135
|
-
sferik: I'm trying to debug the issue you were having with the Bundler Gemfile.lock shortref. What version of Ruby and RubyGems are you running? (
|
129
|
+
sferik: Sounds good. Meeting Tuesday is fine. (a year ago)
|
130
|
+
sferik: That's great news! Let's plan to chat around 8 AM tomorrow Pacific time. Does that work for you? (a year ago)
|
131
|
+
sferik: I asked Yehuda about the stipend. I believe it has already been sent. Glad you're feeling better. (a year ago)
|
132
|
+
sferik: Just checking in. How's everything going? (a year ago)
|
133
|
+
sferik: Not sure about the payment. Feel free to ask Leah or Yehuda directly. Think you'll be able to finish up your work on graphs this weekend? (a year ago)
|
134
|
+
sferik: How are the graph enhancements coming? (a year ago)
|
135
|
+
sferik: How are the graphs coming? I'm really looking forward to seeing what you do with Raphaël. (a year ago)
|
136
|
+
sferik: Awesome! Any luck duplicating the Gemfile.lock error with Ruby 1.9.2 final? (a year ago)
|
137
|
+
sferik: I just committed a bunch of cleanup and fixes to RailsAdmin that touched many of files. Make sure you pull to avoid conflicts. (a year ago)
|
138
|
+
sferik: I'm trying to debug the issue you were having with the Bundler Gemfile.lock shortref. What version of Ruby and RubyGems are you running? (a year ago)
|
136
139
|
eos
|
137
140
|
end
|
138
141
|
context "--csv" do
|
@@ -186,8 +189,13 @@ ID Posted at Screen name Text
|
|
186
189
|
with(:query => {:count => "200"}).
|
187
190
|
to_return(:body => fixture("direct_messages.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
188
191
|
stub_get("/1/direct_messages.json").
|
189
|
-
with(:query => {:count => "
|
190
|
-
to_return(:body => fixture("
|
192
|
+
with(:query => {:count => "200", :max_id => "1624782205"}).
|
193
|
+
to_return(:body => fixture("direct_messages.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
194
|
+
(5..195).step(10).to_a.reverse.each do |count|
|
195
|
+
stub_get("/1/direct_messages.json").
|
196
|
+
with(:query => {:count => count, :max_id => "1624782205"}).
|
197
|
+
to_return(:body => fixture("direct_messages.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
198
|
+
end
|
191
199
|
end
|
192
200
|
it "should limit the number of results to 1" do
|
193
201
|
@cli.options = @cli.options.merge("number" => 1)
|
@@ -203,8 +211,13 @@ ID Posted at Screen name Text
|
|
203
211
|
with(:query => {:count => "200"}).
|
204
212
|
should have_been_made
|
205
213
|
a_get("/1/direct_messages.json").
|
206
|
-
with(:query => {:count => "
|
207
|
-
should have_been_made
|
214
|
+
with(:query => {:count => "200", :max_id => "1624782205"}).
|
215
|
+
should have_been_made.times(14)
|
216
|
+
(5..195).step(10).to_a.reverse.each do |count|
|
217
|
+
a_get("/1/direct_messages.json").
|
218
|
+
with(:query => {:count => count, :max_id => "1624782205"}).
|
219
|
+
should have_been_made
|
220
|
+
end
|
208
221
|
end
|
209
222
|
end
|
210
223
|
context "--reverse" do
|
@@ -214,16 +227,16 @@ ID Posted at Screen name Text
|
|
214
227
|
it "should reverse the order of the sort" do
|
215
228
|
@cli.direct_messages
|
216
229
|
$stdout.string.should == <<-eos
|
217
|
-
sferik: I'm trying to debug the issue you were having with the Bundler Gemfile.lock shortref. What version of Ruby and RubyGems are you running? (
|
218
|
-
sferik: I just committed a bunch of cleanup and fixes to RailsAdmin that touched many of files. Make sure you pull to avoid conflicts. (
|
219
|
-
sferik: Awesome! Any luck duplicating the Gemfile.lock error with Ruby 1.9.2 final? (
|
220
|
-
sferik: How are the graphs coming? I'm really looking forward to seeing what you do with Raphaël. (
|
221
|
-
sferik: How are the graph enhancements coming? (
|
222
|
-
sferik: Not sure about the payment. Feel free to ask Leah or Yehuda directly. Think you'll be able to finish up your work on graphs this weekend? (
|
223
|
-
sferik: Just checking in. How's everything going? (
|
224
|
-
sferik: I asked Yehuda about the stipend. I believe it has already been sent. Glad you're feeling better. (
|
225
|
-
sferik: That's great news! Let's plan to chat around 8 AM tomorrow Pacific time. Does that work for you? (
|
226
|
-
sferik: Sounds good. Meeting Tuesday is fine. (
|
230
|
+
sferik: I'm trying to debug the issue you were having with the Bundler Gemfile.lock shortref. What version of Ruby and RubyGems are you running? (a year ago)
|
231
|
+
sferik: I just committed a bunch of cleanup and fixes to RailsAdmin that touched many of files. Make sure you pull to avoid conflicts. (a year ago)
|
232
|
+
sferik: Awesome! Any luck duplicating the Gemfile.lock error with Ruby 1.9.2 final? (a year ago)
|
233
|
+
sferik: How are the graphs coming? I'm really looking forward to seeing what you do with Raphaël. (a year ago)
|
234
|
+
sferik: How are the graph enhancements coming? (a year ago)
|
235
|
+
sferik: Not sure about the payment. Feel free to ask Leah or Yehuda directly. Think you'll be able to finish up your work on graphs this weekend? (a year ago)
|
236
|
+
sferik: Just checking in. How's everything going? (a year ago)
|
237
|
+
sferik: I asked Yehuda about the stipend. I believe it has already been sent. Glad you're feeling better. (a year ago)
|
238
|
+
sferik: That's great news! Let's plan to chat around 8 AM tomorrow Pacific time. Does that work for you? (a year ago)
|
239
|
+
sferik: Sounds good. Meeting Tuesday is fine. (a year ago)
|
227
240
|
eos
|
228
241
|
end
|
229
242
|
end
|
@@ -234,6 +247,9 @@ ID Posted at Screen name Text
|
|
234
247
|
stub_get("/1/direct_messages/sent.json").
|
235
248
|
with(:query => {:count => "20"}).
|
236
249
|
to_return(:body => fixture("direct_messages.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
250
|
+
stub_get("/1/direct_messages/sent.json").
|
251
|
+
with(:query => {:count => "10", "max_id"=>"1624782205"}).
|
252
|
+
to_return(:body => fixture("empty_array.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
237
253
|
end
|
238
254
|
it "should request the correct resource" do
|
239
255
|
@cli.direct_messages_sent
|
@@ -244,16 +260,16 @@ ID Posted at Screen name Text
|
|
244
260
|
it "should have the correct output" do
|
245
261
|
@cli.direct_messages_sent
|
246
262
|
$stdout.string.should == <<-eos
|
247
|
-
hurrycane: Sounds good. Meeting Tuesday is fine. (
|
248
|
-
hurrycane: That's great news! Let's plan to chat around 8 AM tomorrow Pacific time. Does that work for you? (
|
249
|
-
hurrycane: I asked Yehuda about the stipend. I believe it has already been sent. Glad you're feeling better. (
|
250
|
-
hurrycane: Just checking in. How's everything going? (
|
251
|
-
hurrycane: Not sure about the payment. Feel free to ask Leah or Yehuda directly. Think you'll be able to finish up your work on graphs this weekend? (
|
252
|
-
hurrycane: How are the graph enhancements coming? (
|
253
|
-
hurrycane: How are the graphs coming? I'm really looking forward to seeing what you do with Raphaël. (
|
254
|
-
hurrycane: Awesome! Any luck duplicating the Gemfile.lock error with Ruby 1.9.2 final? (
|
255
|
-
hurrycane: I just committed a bunch of cleanup and fixes to RailsAdmin that touched many of files. Make sure you pull to avoid conflicts. (
|
256
|
-
hurrycane: I'm trying to debug the issue you were having with the Bundler Gemfile.lock shortref. What version of Ruby and RubyGems are you running? (
|
263
|
+
hurrycane: Sounds good. Meeting Tuesday is fine. (a year ago)
|
264
|
+
hurrycane: That's great news! Let's plan to chat around 8 AM tomorrow Pacific time. Does that work for you? (a year ago)
|
265
|
+
hurrycane: I asked Yehuda about the stipend. I believe it has already been sent. Glad you're feeling better. (a year ago)
|
266
|
+
hurrycane: Just checking in. How's everything going? (a year ago)
|
267
|
+
hurrycane: Not sure about the payment. Feel free to ask Leah or Yehuda directly. Think you'll be able to finish up your work on graphs this weekend? (a year ago)
|
268
|
+
hurrycane: How are the graph enhancements coming? (a year ago)
|
269
|
+
hurrycane: How are the graphs coming? I'm really looking forward to seeing what you do with Raphaël. (a year ago)
|
270
|
+
hurrycane: Awesome! Any luck duplicating the Gemfile.lock error with Ruby 1.9.2 final? (a year ago)
|
271
|
+
hurrycane: I just committed a bunch of cleanup and fixes to RailsAdmin that touched many of files. Make sure you pull to avoid conflicts. (a year ago)
|
272
|
+
hurrycane: I'm trying to debug the issue you were having with the Bundler Gemfile.lock shortref. What version of Ruby and RubyGems are you running? (a year ago)
|
257
273
|
eos
|
258
274
|
end
|
259
275
|
context "--csv" do
|
@@ -307,8 +323,13 @@ ID Posted at Screen name Text
|
|
307
323
|
with(:query => {:count => "200"}).
|
308
324
|
to_return(:body => fixture("direct_messages.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
309
325
|
stub_get("/1/direct_messages/sent.json").
|
310
|
-
with(:query => {:count => "
|
326
|
+
with(:query => {:count => "200", :max_id => "1624782205"}).
|
311
327
|
to_return(:body => fixture("direct_messages.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
328
|
+
(5..195).step(10).to_a.reverse.each do |count|
|
329
|
+
stub_get("/1/direct_messages/sent.json").
|
330
|
+
with(:query => {:count => count, :max_id => "1624782205"}).
|
331
|
+
to_return(:body => fixture("direct_messages.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
332
|
+
end
|
312
333
|
end
|
313
334
|
it "should limit the number of results 1" do
|
314
335
|
@cli.options = @cli.options.merge("number" => 1)
|
@@ -324,8 +345,13 @@ ID Posted at Screen name Text
|
|
324
345
|
with(:query => {:count => "200"}).
|
325
346
|
should have_been_made
|
326
347
|
a_get("/1/direct_messages/sent.json").
|
327
|
-
with(:query => {:count => "
|
328
|
-
should have_been_made
|
348
|
+
with(:query => {:count => "200", :max_id => "1624782205"}).
|
349
|
+
should have_been_made.times(14)
|
350
|
+
(5..195).step(10).to_a.reverse.each do |count|
|
351
|
+
a_get("/1/direct_messages/sent.json").
|
352
|
+
with(:query => {:count => count, :max_id => "1624782205"}).
|
353
|
+
should have_been_made
|
354
|
+
end
|
329
355
|
end
|
330
356
|
end
|
331
357
|
context "--reverse" do
|
@@ -335,16 +361,16 @@ ID Posted at Screen name Text
|
|
335
361
|
it "should reverse the order of the sort" do
|
336
362
|
@cli.direct_messages_sent
|
337
363
|
$stdout.string.should == <<-eos
|
338
|
-
hurrycane: I'm trying to debug the issue you were having with the Bundler Gemfile.lock shortref. What version of Ruby and RubyGems are you running? (
|
339
|
-
hurrycane: I just committed a bunch of cleanup and fixes to RailsAdmin that touched many of files. Make sure you pull to avoid conflicts. (
|
340
|
-
hurrycane: Awesome! Any luck duplicating the Gemfile.lock error with Ruby 1.9.2 final? (
|
341
|
-
hurrycane: How are the graphs coming? I'm really looking forward to seeing what you do with Raphaël. (
|
342
|
-
hurrycane: How are the graph enhancements coming? (
|
343
|
-
hurrycane: Not sure about the payment. Feel free to ask Leah or Yehuda directly. Think you'll be able to finish up your work on graphs this weekend? (
|
344
|
-
hurrycane: Just checking in. How's everything going? (
|
345
|
-
hurrycane: I asked Yehuda about the stipend. I believe it has already been sent. Glad you're feeling better. (
|
346
|
-
hurrycane: That's great news! Let's plan to chat around 8 AM tomorrow Pacific time. Does that work for you? (
|
347
|
-
hurrycane: Sounds good. Meeting Tuesday is fine. (
|
364
|
+
hurrycane: I'm trying to debug the issue you were having with the Bundler Gemfile.lock shortref. What version of Ruby and RubyGems are you running? (a year ago)
|
365
|
+
hurrycane: I just committed a bunch of cleanup and fixes to RailsAdmin that touched many of files. Make sure you pull to avoid conflicts. (a year ago)
|
366
|
+
hurrycane: Awesome! Any luck duplicating the Gemfile.lock error with Ruby 1.9.2 final? (a year ago)
|
367
|
+
hurrycane: How are the graphs coming? I'm really looking forward to seeing what you do with Raphaël. (a year ago)
|
368
|
+
hurrycane: How are the graph enhancements coming? (a year ago)
|
369
|
+
hurrycane: Not sure about the payment. Feel free to ask Leah or Yehuda directly. Think you'll be able to finish up your work on graphs this weekend? (a year ago)
|
370
|
+
hurrycane: Just checking in. How's everything going? (a year ago)
|
371
|
+
hurrycane: I asked Yehuda about the stipend. I believe it has already been sent. Glad you're feeling better. (a year ago)
|
372
|
+
hurrycane: That's great news! Let's plan to chat around 8 AM tomorrow Pacific time. Does that work for you? (a year ago)
|
373
|
+
hurrycane: Sounds good. Meeting Tuesday is fine. (a year ago)
|
348
374
|
eos
|
349
375
|
end
|
350
376
|
end
|
@@ -538,7 +564,7 @@ ID Since Tweets Favorites Listed Following Followers Scre...
|
|
538
564
|
end
|
539
565
|
it "should have the correct output" do
|
540
566
|
@cli.dm("pengwynn", "Creating a fixture for the Twitter gem")
|
541
|
-
$stdout.string.chomp.should == "Direct Message sent from @testcli to @pengwynn (
|
567
|
+
$stdout.string.chomp.should == "Direct Message sent from @testcli to @pengwynn (a year ago)."
|
542
568
|
end
|
543
569
|
context "--id" do
|
544
570
|
before do
|
@@ -646,13 +672,13 @@ ID Since Tweets Favorites Listed Following Followers Scre...
|
|
646
672
|
before do
|
647
673
|
@cli.options = @cli.options.merge("profile" => fixture_path + "/.trc")
|
648
674
|
stub_get("/1/friendships/exists.json").
|
649
|
-
with(:query => {:
|
675
|
+
with(:query => {:screen_name_a => "ev", :screen_name_b => "testcli"}).
|
650
676
|
to_return(:body => fixture("true.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
651
677
|
end
|
652
678
|
it "should request the correct resource" do
|
653
679
|
@cli.does_follow("ev")
|
654
680
|
a_get("/1/friendships/exists.json").
|
655
|
-
with(:query => {:
|
681
|
+
with(:query => {:screen_name_a => "ev", :screen_name_b => "testcli"}).
|
656
682
|
should have_been_made
|
657
683
|
end
|
658
684
|
it "should have the correct output" do
|
@@ -666,7 +692,7 @@ ID Since Tweets Favorites Listed Following Followers Scre...
|
|
666
692
|
with(:query => {:user_id => "20"}).
|
667
693
|
to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
668
694
|
stub_get("/1/friendships/exists.json").
|
669
|
-
with(:query => {:
|
695
|
+
with(:query => {:screen_name_a => "sferik", :screen_name_b => "testcli"}).
|
670
696
|
to_return(:body => fixture("true.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
671
697
|
end
|
672
698
|
it "should request the correct resource" do
|
@@ -675,7 +701,7 @@ ID Since Tweets Favorites Listed Following Followers Scre...
|
|
675
701
|
with(:query => {:user_id => "20"}).
|
676
702
|
should have_been_made
|
677
703
|
a_get("/1/friendships/exists.json").
|
678
|
-
with(:query => {:
|
704
|
+
with(:query => {:screen_name_a => "sferik", :screen_name_b => "testcli"}).
|
679
705
|
should have_been_made
|
680
706
|
end
|
681
707
|
end
|
@@ -694,7 +720,7 @@ ID Since Tweets Favorites Listed Following Followers Scre...
|
|
694
720
|
with(:query => {:user_id => "428004849"}).
|
695
721
|
to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
696
722
|
stub_get("/1/friendships/exists.json").
|
697
|
-
with(:query => {:
|
723
|
+
with(:query => {:screen_name_a => "sferik", :screen_name_b => "sferik"}).
|
698
724
|
to_return(:body => fixture("true.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
699
725
|
end
|
700
726
|
it "should request the correct resource" do
|
@@ -706,7 +732,7 @@ ID Since Tweets Favorites Listed Following Followers Scre...
|
|
706
732
|
with(:query => {:user_id => "428004849"}).
|
707
733
|
should have_been_made
|
708
734
|
a_get("/1/friendships/exists.json").
|
709
|
-
with(:query => {:
|
735
|
+
with(:query => {:screen_name_a => "sferik", :screen_name_b => "sferik"}).
|
710
736
|
should have_been_made
|
711
737
|
end
|
712
738
|
end
|
@@ -714,7 +740,7 @@ ID Since Tweets Favorites Listed Following Followers Scre...
|
|
714
740
|
context "false" do
|
715
741
|
before do
|
716
742
|
stub_get("/1/friendships/exists.json").
|
717
|
-
with(:query => {:
|
743
|
+
with(:query => {:screen_name_a => "ev", :screen_name_b => "testcli"}).
|
718
744
|
to_return(:body => fixture("false.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
719
745
|
end
|
720
746
|
it "should exit" do
|
@@ -722,7 +748,7 @@ ID Since Tweets Favorites Listed Following Followers Scre...
|
|
722
748
|
@cli.does_follow("ev")
|
723
749
|
end.should raise_error(SystemExit)
|
724
750
|
a_get("/1/friendships/exists.json").
|
725
|
-
with(:query => {:
|
751
|
+
with(:query => {:screen_name_a => "ev", :screen_name_b => "testcli"}).
|
726
752
|
should have_been_made
|
727
753
|
end
|
728
754
|
end
|
@@ -771,6 +797,9 @@ ID Since Tweets Favorites Listed Following Followers Scre...
|
|
771
797
|
@cli.favorites
|
772
798
|
$stdout.string.should == <<-eos
|
773
799
|
ID,Posted at,Screen name,Text
|
800
|
+
194548141663027221,2011-04-23 22:08:32 +0000,ryanbigg,"Things that have made my life better, in order of greatness: GitHub, Travis CI, the element Oxygen."
|
801
|
+
194563027248121416,2011-04-23 22:08:11 +0000,sfbike,"Bike to Work Counts in: 73% of morning Market traffic was bikes! 1,031 bikers counted in 1 hour--that's 17 per minute. Way to roll, SF!"
|
802
|
+
194548120271416632,2011-04-23 22:07:51 +0000,levie,"I know you're as rare as leprechauns, but if you're an amazing designer then Box wants to hire you. Email recruiting@box.com"
|
774
803
|
194548121416630272,2011-04-23 22:07:41 +0000,natevillegas,RT @gelobautista #riordan RT @WilI_Smith: Yesterday is history. Tomorrow is a mystery. Today is a gift. That's why it's called the present.
|
775
804
|
194547993607806976,2011-04-23 22:07:10 +0000,TD,@kelseysilver how long will you be in town?
|
776
805
|
194547987593183233,2011-04-23 22:07:09 +0000,rusashka,@maciej hahaha :) @gpena together we're going to cover all core 28 languages!
|
@@ -799,6 +828,9 @@ ID,Posted at,Screen name,Text
|
|
799
828
|
@cli.favorites
|
800
829
|
$stdout.string.should == <<-eos
|
801
830
|
ID Posted at Screen name Text
|
831
|
+
194548141663027221 Apr 23 2011 @ryanbigg Things that have made my lif...
|
832
|
+
194563027248121416 Apr 23 2011 @sfbike Bike to Work Counts in: 73% ...
|
833
|
+
194548120271416632 Apr 23 2011 @levie I know you're as rare as lep...
|
802
834
|
194548121416630272 Apr 23 2011 @natevillegas RT @gelobautista #riordan RT...
|
803
835
|
194547993607806976 Apr 23 2011 @TD @kelseysilver how long will ...
|
804
836
|
194547987593183233 Apr 23 2011 @rusashka @maciej hahaha :) @gpena tog...
|
@@ -843,6 +875,9 @@ ID Posted at Screen name Text
|
|
843
875
|
194547987593183233 Apr 23 2011 @rusashka @maciej hahaha :) @gpena tog...
|
844
876
|
194547993607806976 Apr 23 2011 @TD @kelseysilver how long will ...
|
845
877
|
194548121416630272 Apr 23 2011 @natevillegas RT @gelobautista #riordan RT...
|
878
|
+
194548120271416632 Apr 23 2011 @levie I know you're as rare as lep...
|
879
|
+
194563027248121416 Apr 23 2011 @sfbike Bike to Work Counts in: 73% ...
|
880
|
+
194548141663027221 Apr 23 2011 @ryanbigg Things that have made my lif...
|
846
881
|
eos
|
847
882
|
end
|
848
883
|
end
|
@@ -856,8 +891,13 @@ ID Posted at Screen name Text
|
|
856
891
|
with(:query => {:count => "200"}).
|
857
892
|
to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
858
893
|
stub_get("/1/favorites.json").
|
859
|
-
with(:query => {:count => "
|
860
|
-
to_return(:body => fixture("
|
894
|
+
with(:query => {:count => "200", :max_id => "194546264212385792"}).
|
895
|
+
to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
896
|
+
(5..185).step(20).to_a.reverse.each do |count|
|
897
|
+
stub_get("/1/favorites.json").
|
898
|
+
with(:query => {:count => count, :max_id => "194546264212385792"}).
|
899
|
+
to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
900
|
+
end
|
861
901
|
end
|
862
902
|
it "should limit the number of results to 1" do
|
863
903
|
@cli.options = @cli.options.merge("number" => 1)
|
@@ -873,8 +913,13 @@ ID Posted at Screen name Text
|
|
873
913
|
with(:query => {:count => "200"}).
|
874
914
|
should have_been_made
|
875
915
|
a_get("/1/favorites.json").
|
876
|
-
with(:query => {:count => "
|
877
|
-
should have_been_made
|
916
|
+
with(:query => {:count => "200", :max_id => "194546264212385792"}).
|
917
|
+
should have_been_made.times(7)
|
918
|
+
(5..185).step(20).to_a.reverse.each do |count|
|
919
|
+
a_get("/1/favorites.json").
|
920
|
+
with(:query => {:count => count, :max_id => "194546264212385792"}).
|
921
|
+
should have_been_made
|
922
|
+
end
|
878
923
|
end
|
879
924
|
end
|
880
925
|
context "with a user passed" do
|
@@ -1767,6 +1812,9 @@ ID Created at Screen name Slug Members Subscribers ...
|
|
1767
1812
|
@cli.mentions
|
1768
1813
|
$stdout.string.should == <<-eos
|
1769
1814
|
ID,Posted at,Screen name,Text
|
1815
|
+
194548141663027221,2011-04-23 22:08:32 +0000,ryanbigg,"Things that have made my life better, in order of greatness: GitHub, Travis CI, the element Oxygen."
|
1816
|
+
194563027248121416,2011-04-23 22:08:11 +0000,sfbike,"Bike to Work Counts in: 73% of morning Market traffic was bikes! 1,031 bikers counted in 1 hour--that's 17 per minute. Way to roll, SF!"
|
1817
|
+
194548120271416632,2011-04-23 22:07:51 +0000,levie,"I know you're as rare as leprechauns, but if you're an amazing designer then Box wants to hire you. Email recruiting@box.com"
|
1770
1818
|
194548121416630272,2011-04-23 22:07:41 +0000,natevillegas,RT @gelobautista #riordan RT @WilI_Smith: Yesterday is history. Tomorrow is a mystery. Today is a gift. That's why it's called the present.
|
1771
1819
|
194547993607806976,2011-04-23 22:07:10 +0000,TD,@kelseysilver how long will you be in town?
|
1772
1820
|
194547987593183233,2011-04-23 22:07:09 +0000,rusashka,@maciej hahaha :) @gpena together we're going to cover all core 28 languages!
|
@@ -1795,6 +1843,9 @@ ID,Posted at,Screen name,Text
|
|
1795
1843
|
@cli.mentions
|
1796
1844
|
$stdout.string.should == <<-eos
|
1797
1845
|
ID Posted at Screen name Text
|
1846
|
+
194548141663027221 Apr 23 2011 @ryanbigg Things that have made my lif...
|
1847
|
+
194563027248121416 Apr 23 2011 @sfbike Bike to Work Counts in: 73% ...
|
1848
|
+
194548120271416632 Apr 23 2011 @levie I know you're as rare as lep...
|
1798
1849
|
194548121416630272 Apr 23 2011 @natevillegas RT @gelobautista #riordan RT...
|
1799
1850
|
194547993607806976 Apr 23 2011 @TD @kelseysilver how long will ...
|
1800
1851
|
194547987593183233 Apr 23 2011 @rusashka @maciej hahaha :) @gpena tog...
|
@@ -1839,6 +1890,9 @@ ID Posted at Screen name Text
|
|
1839
1890
|
194547987593183233 Apr 23 2011 @rusashka @maciej hahaha :) @gpena tog...
|
1840
1891
|
194547993607806976 Apr 23 2011 @TD @kelseysilver how long will ...
|
1841
1892
|
194548121416630272 Apr 23 2011 @natevillegas RT @gelobautista #riordan RT...
|
1893
|
+
194548120271416632 Apr 23 2011 @levie I know you're as rare as lep...
|
1894
|
+
194563027248121416 Apr 23 2011 @sfbike Bike to Work Counts in: 73% ...
|
1895
|
+
194548141663027221 Apr 23 2011 @ryanbigg Things that have made my lif...
|
1842
1896
|
eos
|
1843
1897
|
end
|
1844
1898
|
end
|
@@ -1852,8 +1906,13 @@ ID Posted at Screen name Text
|
|
1852
1906
|
with(:query => {:count => "200"}).
|
1853
1907
|
to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
1854
1908
|
stub_get("/1/statuses/mentions.json").
|
1855
|
-
with(:query => {:count => "
|
1856
|
-
to_return(:body => fixture("
|
1909
|
+
with(:query => {:count => "200", :max_id => "194546264212385792"}).
|
1910
|
+
to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
1911
|
+
(5..185).step(20).to_a.reverse.each do |count|
|
1912
|
+
stub_get("/1/statuses/mentions.json").
|
1913
|
+
with(:query => {:count => count, :max_id => "194546264212385792"}).
|
1914
|
+
to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
1915
|
+
end
|
1857
1916
|
end
|
1858
1917
|
it "should limit the number of results to 1" do
|
1859
1918
|
@cli.options = @cli.options.merge("number" => 1)
|
@@ -1869,8 +1928,13 @@ ID Posted at Screen name Text
|
|
1869
1928
|
with(:query => {:count => "200"}).
|
1870
1929
|
should have_been_made
|
1871
1930
|
a_get("/1/statuses/mentions.json").
|
1872
|
-
with(:query => {:count => "
|
1873
|
-
should have_been_made
|
1931
|
+
with(:query => {:count => "200", :max_id => "194546264212385792"}).
|
1932
|
+
should have_been_made.times(7)
|
1933
|
+
(5..185).step(20).to_a.reverse.each do |count|
|
1934
|
+
a_get("/1/statuses/mentions.json").
|
1935
|
+
with(:query => {:count => count, :max_id => "194546264212385792"}).
|
1936
|
+
should have_been_made
|
1937
|
+
end
|
1874
1938
|
end
|
1875
1939
|
end
|
1876
1940
|
end
|
@@ -1934,7 +1998,7 @@ ID Posted at Screen name Text
|
|
1934
1998
|
$stdout.string.should == <<-eos
|
1935
1999
|
Hourly limit 20,000
|
1936
2000
|
Remaining hits 19,993
|
1937
|
-
Reset time Oct 26 2010 (
|
2001
|
+
Reset time Oct 26 2010 (a year from now)
|
1938
2002
|
eos
|
1939
2003
|
end
|
1940
2004
|
context "--csv" do
|
@@ -2084,6 +2148,9 @@ Hourly limit,Remaining hits,Reset time
|
|
2084
2148
|
@cli.retweets
|
2085
2149
|
$stdout.string.should == <<-eos
|
2086
2150
|
ID,Posted at,Screen name,Text
|
2151
|
+
194548141663027221,2011-04-23 22:08:32 +0000,ryanbigg,"Things that have made my life better, in order of greatness: GitHub, Travis CI, the element Oxygen."
|
2152
|
+
194563027248121416,2011-04-23 22:08:11 +0000,sfbike,"Bike to Work Counts in: 73% of morning Market traffic was bikes! 1,031 bikers counted in 1 hour--that's 17 per minute. Way to roll, SF!"
|
2153
|
+
194548120271416632,2011-04-23 22:07:51 +0000,levie,"I know you're as rare as leprechauns, but if you're an amazing designer then Box wants to hire you. Email recruiting@box.com"
|
2087
2154
|
194548121416630272,2011-04-23 22:07:41 +0000,natevillegas,RT @gelobautista #riordan RT @WilI_Smith: Yesterday is history. Tomorrow is a mystery. Today is a gift. That's why it's called the present.
|
2088
2155
|
194547993607806976,2011-04-23 22:07:10 +0000,TD,@kelseysilver how long will you be in town?
|
2089
2156
|
194547987593183233,2011-04-23 22:07:09 +0000,rusashka,@maciej hahaha :) @gpena together we're going to cover all core 28 languages!
|
@@ -2112,6 +2179,9 @@ ID,Posted at,Screen name,Text
|
|
2112
2179
|
@cli.retweets
|
2113
2180
|
$stdout.string.should == <<-eos
|
2114
2181
|
ID Posted at Screen name Text
|
2182
|
+
194548141663027221 Apr 23 2011 @ryanbigg Things that have made my lif...
|
2183
|
+
194563027248121416 Apr 23 2011 @sfbike Bike to Work Counts in: 73% ...
|
2184
|
+
194548120271416632 Apr 23 2011 @levie I know you're as rare as lep...
|
2115
2185
|
194548121416630272 Apr 23 2011 @natevillegas RT @gelobautista #riordan RT...
|
2116
2186
|
194547993607806976 Apr 23 2011 @TD @kelseysilver how long will ...
|
2117
2187
|
194547987593183233 Apr 23 2011 @rusashka @maciej hahaha :) @gpena tog...
|
@@ -2156,6 +2226,9 @@ ID Posted at Screen name Text
|
|
2156
2226
|
194547987593183233 Apr 23 2011 @rusashka @maciej hahaha :) @gpena tog...
|
2157
2227
|
194547993607806976 Apr 23 2011 @TD @kelseysilver how long will ...
|
2158
2228
|
194548121416630272 Apr 23 2011 @natevillegas RT @gelobautista #riordan RT...
|
2229
|
+
194548120271416632 Apr 23 2011 @levie I know you're as rare as lep...
|
2230
|
+
194563027248121416 Apr 23 2011 @sfbike Bike to Work Counts in: 73% ...
|
2231
|
+
194548141663027221 Apr 23 2011 @ryanbigg Things that have made my lif...
|
2159
2232
|
eos
|
2160
2233
|
end
|
2161
2234
|
end
|
@@ -2169,8 +2242,13 @@ ID Posted at Screen name Text
|
|
2169
2242
|
with(:query => {:count => "200"}).
|
2170
2243
|
to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
2171
2244
|
stub_get("/1/statuses/retweeted_by_me.json").
|
2172
|
-
with(:query => {:count => "
|
2173
|
-
to_return(:body => fixture("
|
2245
|
+
with(:query => {:count => "200", :max_id => "194546264212385792"}).
|
2246
|
+
to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
2247
|
+
(5..185).step(20).to_a.reverse.each do |count|
|
2248
|
+
stub_get("/1/statuses/retweeted_by_me.json").
|
2249
|
+
with(:query => {:count => count, :max_id => "194546264212385792"}).
|
2250
|
+
to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
2251
|
+
end
|
2174
2252
|
end
|
2175
2253
|
it "should limit the number of results to 1" do
|
2176
2254
|
@cli.options = @cli.options.merge("number" => 1)
|
@@ -2186,8 +2264,13 @@ ID Posted at Screen name Text
|
|
2186
2264
|
with(:query => {:count => "200"}).
|
2187
2265
|
should have_been_made
|
2188
2266
|
a_get("/1/statuses/retweeted_by_me.json").
|
2189
|
-
with(:query => {:count => "
|
2190
|
-
should have_been_made
|
2267
|
+
with(:query => {:count => "200", :max_id => "194546264212385792"}).
|
2268
|
+
should have_been_made.times(7)
|
2269
|
+
(5..185).step(20).to_a.reverse.each do |count|
|
2270
|
+
a_get("/1/statuses/retweeted_by_me.json").
|
2271
|
+
with(:query => {:count => count, :max_id => "194546264212385792"}).
|
2272
|
+
should have_been_made
|
2273
|
+
end
|
2191
2274
|
end
|
2192
2275
|
end
|
2193
2276
|
context "with a user passed" do
|
@@ -2560,6 +2643,9 @@ ID Since Tweets Favorites Listed Following Followers Scre...
|
|
2560
2643
|
@cli.timeline
|
2561
2644
|
$stdout.string.should == <<-eos
|
2562
2645
|
ID,Posted at,Screen name,Text
|
2646
|
+
194548141663027221,2011-04-23 22:08:32 +0000,ryanbigg,"Things that have made my life better, in order of greatness: GitHub, Travis CI, the element Oxygen."
|
2647
|
+
194563027248121416,2011-04-23 22:08:11 +0000,sfbike,"Bike to Work Counts in: 73% of morning Market traffic was bikes! 1,031 bikers counted in 1 hour--that's 17 per minute. Way to roll, SF!"
|
2648
|
+
194548120271416632,2011-04-23 22:07:51 +0000,levie,"I know you're as rare as leprechauns, but if you're an amazing designer then Box wants to hire you. Email recruiting@box.com"
|
2563
2649
|
194548121416630272,2011-04-23 22:07:41 +0000,natevillegas,RT @gelobautista #riordan RT @WilI_Smith: Yesterday is history. Tomorrow is a mystery. Today is a gift. That's why it's called the present.
|
2564
2650
|
194547993607806976,2011-04-23 22:07:10 +0000,TD,@kelseysilver how long will you be in town?
|
2565
2651
|
194547987593183233,2011-04-23 22:07:09 +0000,rusashka,@maciej hahaha :) @gpena together we're going to cover all core 28 languages!
|
@@ -2588,6 +2674,9 @@ ID,Posted at,Screen name,Text
|
|
2588
2674
|
@cli.timeline
|
2589
2675
|
$stdout.string.should == <<-eos
|
2590
2676
|
ID Posted at Screen name Text
|
2677
|
+
194548141663027221 Apr 23 2011 @ryanbigg Things that have made my lif...
|
2678
|
+
194563027248121416 Apr 23 2011 @sfbike Bike to Work Counts in: 73% ...
|
2679
|
+
194548120271416632 Apr 23 2011 @levie I know you're as rare as lep...
|
2591
2680
|
194548121416630272 Apr 23 2011 @natevillegas RT @gelobautista #riordan RT...
|
2592
2681
|
194547993607806976 Apr 23 2011 @TD @kelseysilver how long will ...
|
2593
2682
|
194547987593183233 Apr 23 2011 @rusashka @maciej hahaha :) @gpena tog...
|
@@ -2632,6 +2721,9 @@ ID Posted at Screen name Text
|
|
2632
2721
|
194547987593183233 Apr 23 2011 @rusashka @maciej hahaha :) @gpena tog...
|
2633
2722
|
194547993607806976 Apr 23 2011 @TD @kelseysilver how long will ...
|
2634
2723
|
194548121416630272 Apr 23 2011 @natevillegas RT @gelobautista #riordan RT...
|
2724
|
+
194548120271416632 Apr 23 2011 @levie I know you're as rare as lep...
|
2725
|
+
194563027248121416 Apr 23 2011 @sfbike Bike to Work Counts in: 73% ...
|
2726
|
+
194548141663027221 Apr 23 2011 @ryanbigg Things that have made my lif...
|
2635
2727
|
eos
|
2636
2728
|
end
|
2637
2729
|
end
|
@@ -2645,8 +2737,13 @@ ID Posted at Screen name Text
|
|
2645
2737
|
with(:query => {:count => "200"}).
|
2646
2738
|
to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
2647
2739
|
stub_get("/1/statuses/home_timeline.json").
|
2648
|
-
with(:query => {:count => "
|
2649
|
-
to_return(:body => fixture("
|
2740
|
+
with(:query => {:count => "200", :max_id => "194546264212385792"}).
|
2741
|
+
to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
2742
|
+
(5..185).step(20).to_a.reverse.each do |count|
|
2743
|
+
stub_get("/1/statuses/home_timeline.json").
|
2744
|
+
with(:query => {:count => count, :max_id => "194546264212385792"}).
|
2745
|
+
to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
2746
|
+
end
|
2650
2747
|
end
|
2651
2748
|
it "should limit the number of results to 1" do
|
2652
2749
|
@cli.options = @cli.options.merge("number" => 1)
|
@@ -2662,8 +2759,13 @@ ID Posted at Screen name Text
|
|
2662
2759
|
with(:query => {:count => "200"}).
|
2663
2760
|
should have_been_made
|
2664
2761
|
a_get("/1/statuses/home_timeline.json").
|
2665
|
-
with(:query => {:count => "
|
2666
|
-
should have_been_made
|
2762
|
+
with(:query => {:count => "200", :max_id => "194546264212385792"}).
|
2763
|
+
should have_been_made.times(7)
|
2764
|
+
(5..185).step(20).to_a.reverse.each do |count|
|
2765
|
+
a_get("/1/statuses/home_timeline.json").
|
2766
|
+
with(:query => {:count => count, :max_id => "194546264212385792"}).
|
2767
|
+
should have_been_made
|
2768
|
+
end
|
2667
2769
|
end
|
2668
2770
|
end
|
2669
2771
|
context "with a user passed" do
|
@@ -2701,8 +2803,13 @@ ID Posted at Screen name Text
|
|
2701
2803
|
with(:query => {:count => "200", :screen_name => "sferik"}).
|
2702
2804
|
to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
2703
2805
|
stub_get("/1/statuses/user_timeline.json").
|
2704
|
-
with(:query => {:count => "
|
2705
|
-
to_return(:body => fixture("
|
2806
|
+
with(:query => {:count => "200", :screen_name => "sferik", :max_id => "194546264212385792"}).
|
2807
|
+
to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
2808
|
+
(5..185).step(20).to_a.reverse.each do |count|
|
2809
|
+
stub_get("/1/statuses/user_timeline.json").
|
2810
|
+
with(:query => {:count => count, :screen_name => "sferik", :max_id => "194546264212385792"}).
|
2811
|
+
to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
2812
|
+
end
|
2706
2813
|
end
|
2707
2814
|
it "should limit the number of results to 1" do
|
2708
2815
|
@cli.options = @cli.options.merge("number" => 1)
|
@@ -2718,8 +2825,13 @@ ID Posted at Screen name Text
|
|
2718
2825
|
with(:query => {:count => "200", :screen_name => "sferik"}).
|
2719
2826
|
should have_been_made
|
2720
2827
|
a_get("/1/statuses/user_timeline.json").
|
2721
|
-
with(:query => {:count => "
|
2722
|
-
should have_been_made
|
2828
|
+
with(:query => {:count => "200", :screen_name => "sferik", :max_id => "194546264212385792"}).
|
2829
|
+
should have_been_made.times(7)
|
2830
|
+
(5..185).step(20).to_a.reverse.each do |count|
|
2831
|
+
a_get("/1/statuses/user_timeline.json").
|
2832
|
+
with(:query => {:count => count, :screen_name => "sferik", :max_id => "194546264212385792"}).
|
2833
|
+
should have_been_made
|
2834
|
+
end
|
2723
2835
|
end
|
2724
2836
|
end
|
2725
2837
|
end
|
@@ -3076,7 +3188,7 @@ Bio A mind forever voyaging through strange seas of thought, alone.
|
|
3076
3188
|
Location San Francisco
|
3077
3189
|
Status Not following
|
3078
3190
|
Last update RT @tenderlove: [ANN] sqlite3-ruby => sqlite3 (10 months ago)
|
3079
|
-
Since Jul 16 2007 (
|
3191
|
+
Since Jul 16 2007 (4 years ago)
|
3080
3192
|
Tweets 3,479
|
3081
3193
|
Favorites 1,040
|
3082
3194
|
Listed 41
|