t 1.1.1 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +1 -1
- data/lib/t/cli.rb +22 -51
- data/lib/t/collectable.rb +13 -13
- data/lib/t/delete.rb +6 -6
- data/lib/t/list.rb +2 -2
- data/lib/t/printable.rb +18 -18
- data/lib/t/search.rb +33 -33
- data/lib/t/stream.rb +18 -18
- data/lib/t/version.rb +2 -2
- data/spec/cli_spec.rb +883 -1004
- data/spec/delete_spec.rb +51 -43
- data/spec/fixtures/following.json +1 -0
- data/spec/fixtures/not_following.json +1 -0
- data/spec/fixtures/search.json +1 -456
- data/spec/fixtures/statuses.json +1 -1285
- data/spec/helper.rb +5 -0
- data/spec/list_spec.rb +165 -158
- data/spec/search_spec.rb +318 -245
- data/spec/set_spec.rb +14 -14
- data/spec/stream_spec.rb +307 -0
- data/t.gemspec +2 -2
- metadata +12 -6
data/spec/helper.rb
CHANGED
@@ -11,6 +11,7 @@ require 't'
|
|
11
11
|
require 'rspec'
|
12
12
|
require 'timecop'
|
13
13
|
require 'webmock/rspec'
|
14
|
+
require 'json'
|
14
15
|
|
15
16
|
def a_delete(path, endpoint='https://api.twitter.com')
|
16
17
|
a_request(:delete, endpoint + path)
|
@@ -55,3 +56,7 @@ end
|
|
55
56
|
def fixture(file)
|
56
57
|
File.new(fixture_path + '/' + file)
|
57
58
|
end
|
59
|
+
|
60
|
+
def status_from_fixture(file)
|
61
|
+
Twitter::Status.new(JSON.parse(fixture(file).read, :symbolize_names => true))
|
62
|
+
end
|
data/spec/list_spec.rb
CHANGED
@@ -31,17 +31,17 @@ describe T::List do
|
|
31
31
|
describe "#add" do
|
32
32
|
before do
|
33
33
|
@list.options = @list.options.merge("profile" => fixture_path + "/.trc")
|
34
|
-
stub_get("/1/account/verify_credentials.json").
|
34
|
+
stub_get("/1.1/account/verify_credentials.json").
|
35
35
|
to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
36
|
-
stub_post("/1/lists/members/create_all.json").
|
36
|
+
stub_post("/1.1/lists/members/create_all.json").
|
37
37
|
with(:body => {:screen_name => "BarackObama", :slug => "presidents", :owner_screen_name => "sferik"}).
|
38
38
|
to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
39
39
|
end
|
40
40
|
it "should request the correct resource" do
|
41
41
|
@list.add("presidents", "BarackObama")
|
42
|
-
a_get("/1/account/verify_credentials.json").
|
42
|
+
a_get("/1.1/account/verify_credentials.json").
|
43
43
|
should have_been_made
|
44
|
-
a_post("/1/lists/members/create_all.json").
|
44
|
+
a_post("/1.1/lists/members/create_all.json").
|
45
45
|
with(:body => {:screen_name => "BarackObama", :slug => "presidents", :owner_screen_name => "sferik"}).
|
46
46
|
should have_been_made
|
47
47
|
end
|
@@ -52,28 +52,28 @@ describe T::List do
|
|
52
52
|
context "--id" do
|
53
53
|
before do
|
54
54
|
@list.options = @list.options.merge("id" => true)
|
55
|
-
stub_post("/1/lists/members/create_all.json").
|
55
|
+
stub_post("/1.1/lists/members/create_all.json").
|
56
56
|
with(:body => {:user_id => "7505382", :slug => "presidents", :owner_screen_name => "sferik"}).
|
57
57
|
to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
58
58
|
end
|
59
59
|
it "should request the correct resource" do
|
60
60
|
@list.add("presidents", "7505382")
|
61
|
-
a_get("/1/account/verify_credentials.json").
|
61
|
+
a_get("/1.1/account/verify_credentials.json").
|
62
62
|
should have_been_made
|
63
|
-
a_post("/1/lists/members/create_all.json").
|
63
|
+
a_post("/1.1/lists/members/create_all.json").
|
64
64
|
with(:body => {:user_id => "7505382", :slug => "presidents", :owner_screen_name => "sferik"}).
|
65
65
|
should have_been_made
|
66
66
|
end
|
67
67
|
end
|
68
68
|
context "Twitter is down" do
|
69
69
|
it "should retry 3 times and then raise an error" do
|
70
|
-
stub_post("/1/lists/members/create_all.json").
|
70
|
+
stub_post("/1.1/lists/members/create_all.json").
|
71
71
|
with(:body => {:screen_name => "BarackObama", :slug => "presidents", :owner_screen_name => "sferik"}).
|
72
72
|
to_return(:status => 502)
|
73
73
|
lambda do
|
74
74
|
@list.add("presidents", "BarackObama")
|
75
75
|
end.should raise_error("Twitter is down or being upgraded.")
|
76
|
-
a_post("/1/lists/members/create_all.json").
|
76
|
+
a_post("/1.1/lists/members/create_all.json").
|
77
77
|
with(:body => {:screen_name => "BarackObama", :slug => "presidents", :owner_screen_name => "sferik"}).
|
78
78
|
should have_been_made.times(3)
|
79
79
|
end
|
@@ -83,13 +83,13 @@ describe T::List do
|
|
83
83
|
describe "#create" do
|
84
84
|
before do
|
85
85
|
@list.options = @list.options.merge("profile" => fixture_path + "/.trc")
|
86
|
-
stub_post("/1/lists/create.json").
|
86
|
+
stub_post("/1.1/lists/create.json").
|
87
87
|
with(:body => {:name => "presidents"}).
|
88
88
|
to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
89
89
|
end
|
90
90
|
it "should request the correct resource" do
|
91
91
|
@list.create("presidents")
|
92
|
-
a_post("/1/lists/create.json").
|
92
|
+
a_post("/1.1/lists/create.json").
|
93
93
|
with(:body => {:name => "presidents"}).
|
94
94
|
should have_been_made
|
95
95
|
end
|
@@ -102,13 +102,13 @@ describe T::List do
|
|
102
102
|
describe "#information" do
|
103
103
|
before do
|
104
104
|
@list.options = @list.options.merge("profile" => fixture_path + "/.trc")
|
105
|
-
stub_get("/1/lists/show.json").
|
105
|
+
stub_get("/1.1/lists/show.json").
|
106
106
|
with(:query => {:owner_screen_name => "testcli", :slug => "presidents"}).
|
107
107
|
to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
108
108
|
end
|
109
109
|
it "should request the correct resource" do
|
110
110
|
@list.information("presidents")
|
111
|
-
a_get("/1/lists/show.json").
|
111
|
+
a_get("/1.1/lists/show.json").
|
112
112
|
with(:query => {:owner_screen_name => "testcli", :slug => "presidents"}).
|
113
113
|
should have_been_made
|
114
114
|
end
|
@@ -130,20 +130,20 @@ URL https://twitter.com/sferik/presidents
|
|
130
130
|
context "with a user passed" do
|
131
131
|
it "should request the correct resource" do
|
132
132
|
@list.information("testcli/presidents")
|
133
|
-
a_get("/1/lists/show.json").
|
133
|
+
a_get("/1.1/lists/show.json").
|
134
134
|
with(:query => {:owner_screen_name => "testcli", :slug => "presidents"}).
|
135
135
|
should have_been_made
|
136
136
|
end
|
137
137
|
context "--id" do
|
138
138
|
before do
|
139
139
|
@list.options = @list.options.merge("id" => true)
|
140
|
-
stub_get("/1/lists/show.json").
|
140
|
+
stub_get("/1.1/lists/show.json").
|
141
141
|
with(:query => {:owner_id => "7505382", :slug => "presidents"}).
|
142
142
|
to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
143
143
|
end
|
144
144
|
it "should request the correct resource" do
|
145
145
|
@list.information("7505382/presidents")
|
146
|
-
a_get("/1/lists/show.json").
|
146
|
+
a_get("/1.1/lists/show.json").
|
147
147
|
with(:query => {:owner_id => "7505382", :slug => "presidents"}).
|
148
148
|
should have_been_made
|
149
149
|
end
|
@@ -165,13 +165,13 @@ ID,Description,Slug,Screen name,Created at,Members,Subscribers,Following,Mode,UR
|
|
165
165
|
|
166
166
|
describe "#members" do
|
167
167
|
before do
|
168
|
-
stub_get("/1/lists/members.json").
|
168
|
+
stub_get("/1.1/lists/members.json").
|
169
169
|
with(:query => {:cursor => "-1", :owner_screen_name => "testcli", :skip_status => "true", :slug => "presidents"}).
|
170
170
|
to_return(:body => fixture("users_list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
171
171
|
end
|
172
172
|
it "should request the correct resource" do
|
173
173
|
@list.members("presidents")
|
174
|
-
a_get("/1/lists/members.json").
|
174
|
+
a_get("/1.1/lists/members.json").
|
175
175
|
with(:query => {:cursor => "-1", :owner_screen_name => "testcli", :skip_status => "true", :slug => "presidents"}).
|
176
176
|
should have_been_made
|
177
177
|
end
|
@@ -289,20 +289,20 @@ ID Since Last tweeted at Tweets Favorites Listed Following...
|
|
289
289
|
context "with a user passed" do
|
290
290
|
it "should request the correct resource" do
|
291
291
|
@list.members("testcli/presidents")
|
292
|
-
a_get("/1/lists/members.json").
|
292
|
+
a_get("/1.1/lists/members.json").
|
293
293
|
with(:query => {:cursor => "-1", :owner_screen_name => "testcli", :skip_status => "true", :slug => "presidents"}).
|
294
294
|
should have_been_made
|
295
295
|
end
|
296
296
|
context "--id" do
|
297
297
|
before do
|
298
298
|
@list.options = @list.options.merge("id" => true)
|
299
|
-
stub_get("/1/lists/members.json").
|
299
|
+
stub_get("/1.1/lists/members.json").
|
300
300
|
with(:query => {:cursor => "-1", :owner_id => "7505382", :skip_status => "true", :slug => "presidents"}).
|
301
301
|
to_return(:body => fixture("users_list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
302
302
|
end
|
303
303
|
it "should request the correct resource" do
|
304
304
|
@list.members("7505382/presidents")
|
305
|
-
a_get("/1/lists/members.json").
|
305
|
+
a_get("/1.1/lists/members.json").
|
306
306
|
with(:query => {:cursor => "-1", :owner_id => "7505382", :skip_status => "true", :slug => "presidents"}).
|
307
307
|
should have_been_made
|
308
308
|
end
|
@@ -313,22 +313,22 @@ ID Since Last tweeted at Tweets Favorites Listed Following...
|
|
313
313
|
describe "#remove" do
|
314
314
|
before do
|
315
315
|
@list.options = @list.options.merge("profile" => fixture_path + "/.trc")
|
316
|
-
stub_get("/1/account/verify_credentials.json").
|
316
|
+
stub_get("/1.1/account/verify_credentials.json").
|
317
317
|
to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
318
318
|
end
|
319
319
|
it "should request the correct resource" do
|
320
|
-
stub_post("/1/lists/members/destroy_all.json").
|
320
|
+
stub_post("/1.1/lists/members/destroy_all.json").
|
321
321
|
with(:body => {:screen_name => "BarackObama", :slug => "presidents", :owner_screen_name => "sferik"}).
|
322
322
|
to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
323
323
|
@list.remove("presidents", "BarackObama")
|
324
|
-
a_get("/1/account/verify_credentials.json").
|
324
|
+
a_get("/1.1/account/verify_credentials.json").
|
325
325
|
should have_been_made
|
326
|
-
a_post("/1/lists/members/destroy_all.json").
|
326
|
+
a_post("/1.1/lists/members/destroy_all.json").
|
327
327
|
with(:body => {:screen_name => "BarackObama", :slug => "presidents", :owner_screen_name => "sferik"}).
|
328
328
|
should have_been_made
|
329
329
|
end
|
330
330
|
it "should have the correct output" do
|
331
|
-
stub_post("/1/lists/members/destroy_all.json").
|
331
|
+
stub_post("/1.1/lists/members/destroy_all.json").
|
332
332
|
with(:body => {:screen_name => "BarackObama", :slug => "presidents", :owner_screen_name => "sferik"}).
|
333
333
|
to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
334
334
|
@list.remove("presidents", "BarackObama")
|
@@ -337,28 +337,28 @@ ID Since Last tweeted at Tweets Favorites Listed Following...
|
|
337
337
|
context "--id" do
|
338
338
|
before do
|
339
339
|
@list.options = @list.options.merge("id" => true)
|
340
|
-
stub_post("/1/lists/members/destroy_all.json").
|
340
|
+
stub_post("/1.1/lists/members/destroy_all.json").
|
341
341
|
with(:body => {:user_id => "7505382", :slug => "presidents", :owner_screen_name => "sferik"}).
|
342
342
|
to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
343
343
|
end
|
344
344
|
it "should request the correct resource" do
|
345
345
|
@list.remove("presidents", "7505382")
|
346
|
-
a_get("/1/account/verify_credentials.json").
|
346
|
+
a_get("/1.1/account/verify_credentials.json").
|
347
347
|
should have_been_made
|
348
|
-
a_post("/1/lists/members/destroy_all.json").
|
348
|
+
a_post("/1.1/lists/members/destroy_all.json").
|
349
349
|
with(:body => {:user_id => "7505382", :slug => "presidents", :owner_screen_name => "sferik"}).
|
350
350
|
should have_been_made
|
351
351
|
end
|
352
352
|
end
|
353
353
|
context "Twitter is down" do
|
354
354
|
it "should retry 3 times and then raise an error" do
|
355
|
-
stub_post("/1/lists/members/destroy_all.json").
|
355
|
+
stub_post("/1.1/lists/members/destroy_all.json").
|
356
356
|
with(:body => {:screen_name => "BarackObama", :slug => "presidents", :owner_screen_name => "sferik"}).
|
357
357
|
to_return(:status => 502)
|
358
358
|
lambda do
|
359
359
|
@list.remove("presidents", "BarackObama")
|
360
360
|
end.should raise_error("Twitter is down or being upgraded.")
|
361
|
-
a_post("/1/lists/members/destroy_all.json").
|
361
|
+
a_post("/1.1/lists/members/destroy_all.json").
|
362
362
|
with(:body => {:screen_name => "BarackObama", :slug => "presidents", :owner_screen_name => "sferik"}).
|
363
363
|
should have_been_made.times(3)
|
364
364
|
end
|
@@ -367,86 +367,93 @@ ID Since Last tweeted at Tweets Favorites Listed Following...
|
|
367
367
|
|
368
368
|
describe "#timeline" do
|
369
369
|
before do
|
370
|
-
stub_get("/1/lists/statuses.json").
|
370
|
+
stub_get("/1.1/lists/statuses.json").
|
371
371
|
with(:query => {:owner_screen_name => "testcli", :per_page => "20", :slug => "presidents"}).
|
372
372
|
to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
373
373
|
end
|
374
374
|
it "should request the correct resource" do
|
375
375
|
@list.timeline("presidents")
|
376
|
-
a_get("/1/lists/statuses.json").
|
376
|
+
a_get("/1.1/lists/statuses.json").
|
377
377
|
with(:query => {:owner_screen_name => "testcli", :per_page => "20", :slug => "presidents"}).
|
378
378
|
should have_been_made
|
379
379
|
end
|
380
380
|
it "should have the correct output" do
|
381
381
|
@list.timeline("presidents")
|
382
382
|
$stdout.string.should == <<-eos
|
383
|
-
\e[1m\e[33m @
|
384
|
-
|
385
|
-
CI, the element Oxygen.
|
383
|
+
\e[1m\e[33m @mutgoff\e[0m
|
384
|
+
Happy Birthday @imdane. Watch out for those @rally pranksters!
|
386
385
|
|
387
|
-
\e[1m\e[33m @
|
388
|
-
|
389
|
-
|
386
|
+
\e[1m\e[33m @ironicsans\e[0m
|
387
|
+
If you like good real-life stories, check out @NarrativelyNY's just-launched
|
388
|
+
site http://t.co/wiUL07jE (and also visit http://t.co/ZoyQxqWA)
|
390
389
|
|
391
|
-
\e[1m\e[33m @
|
392
|
-
|
393
|
-
|
390
|
+
\e[1m\e[33m @pat_shaughnessy\e[0m
|
391
|
+
Something else to vote for: "New Rails workshops to bring more women into the
|
392
|
+
Boston software scene" http://t.co/eNBuckHc /cc @bostonrb
|
394
393
|
|
395
|
-
\e[1m\e[33m @
|
396
|
-
|
397
|
-
mystery. Today is a gift. That's why it's called the present.
|
394
|
+
\e[1m\e[33m @calebelston\e[0m
|
395
|
+
Pushing the button to launch the site. http://t.co/qLoEn5jG
|
398
396
|
|
399
|
-
\e[1m\e[33m @
|
400
|
-
@
|
397
|
+
\e[1m\e[33m @calebelston\e[0m
|
398
|
+
RT @olivercameron: Mosaic looks cool: http://t.co/A8013C9k
|
401
399
|
|
402
|
-
\e[1m\e[33m @
|
403
|
-
|
400
|
+
\e[1m\e[33m @fivethirtyeight\e[0m
|
401
|
+
The Weatherman is Not a Moron: http://t.co/ZwL5Gnq5. An excerpt from my book,
|
402
|
+
THE SIGNAL AND THE NOISE (http://t.co/fNXj8vCE)
|
404
403
|
|
405
|
-
\e[1m\e[33m @
|
406
|
-
|
404
|
+
\e[1m\e[33m @codeforamerica\e[0m
|
405
|
+
RT @randomhacks: Going to Code Across Austin II: Y'all Come Hack Now, Sat,
|
406
|
+
Sep 8 http://t.co/Sk5BM7U3 We'll see y'all there! #rhok @codeforamerica
|
407
|
+
@TheaClay
|
407
408
|
|
408
|
-
\e[1m\e[33m @
|
409
|
-
|
409
|
+
\e[1m\e[33m @fbjork\e[0m
|
410
|
+
RT @jondot: Just published: "Pragmatic Concurrency With #Ruby"
|
411
|
+
http://t.co/kGEykswZ /cc @JRuby @headius
|
410
412
|
|
411
|
-
\e[1m\e[33m @
|
412
|
-
|
413
|
+
\e[1m\e[33m @mbostock\e[0m
|
414
|
+
If you are wondering how we computed the split bubbles: http://t.co/BcaqSs5u
|
413
415
|
|
414
|
-
\e[1m\e[33m @
|
415
|
-
|
416
|
-
a clever German. http://t.co/JvLNQCDm @skilldrick @hoverbird
|
416
|
+
\e[1m\e[33m @FakeDorsey\e[0m
|
417
|
+
“Write drunk. Edit sober.”—Ernest Hemingway
|
417
418
|
|
418
|
-
\e[1m\e[33m @
|
419
|
-
|
419
|
+
\e[1m\e[33m @al3x\e[0m
|
420
|
+
RT @wcmaier: Better banking through better ops: build something new with us
|
421
|
+
@Simplify (remote, PDX) http://t.co/8WgzKZH3
|
420
422
|
|
421
|
-
\e[1m\e[33m @
|
422
|
-
|
423
|
+
\e[1m\e[33m @calebelston\e[0m
|
424
|
+
We just announced Mosaic, what we've been working on since the Yobongo
|
425
|
+
acquisition. My personal post, http://t.co/ELOyIRZU @heymosaic
|
423
426
|
|
424
|
-
\e[1m\e[33m @
|
425
|
-
|
427
|
+
\e[1m\e[33m @BarackObama\e[0m
|
428
|
+
Donate $10 or more --> get your favorite car magnet: http://t.co/NfRhl2s2
|
429
|
+
#Obama2012
|
426
430
|
|
427
|
-
\e[1m\e[33m @
|
428
|
-
|
431
|
+
\e[1m\e[33m @JEG2\e[0m
|
432
|
+
RT @tenderlove: If corporations are people, can we use them to drive in the
|
433
|
+
carpool lane?
|
429
434
|
|
430
|
-
\e[1m\e[33m @
|
431
|
-
|
435
|
+
\e[1m\e[33m @eveningedition\e[0m
|
436
|
+
LDN—Obama's nomination; Putin woos APEC; Bombs hit Damascus; Quakes shake
|
437
|
+
China; Canada cuts Iran ties; weekend read: http://t.co/OFs6dVW4
|
432
438
|
|
433
|
-
\e[1m\e[33m @
|
434
|
-
|
435
|
-
|
439
|
+
\e[1m\e[33m @dhh\e[0m
|
440
|
+
RT @ggreenwald: Democrats parade Osama bin Laden's corpse as their proudest
|
441
|
+
achievement: why this goulish jingoism is so warped http://t.co/kood278s
|
436
442
|
|
437
|
-
\e[1m\e[33m @
|
438
|
-
|
439
|
-
|
443
|
+
\e[1m\e[33m @jasonfried\e[0m
|
444
|
+
The story of Mars Curiosity's gears, made by a factory in Rockford, IL:
|
445
|
+
http://t.co/MwCRsHQg
|
440
446
|
|
441
|
-
\e[1m\e[33m @
|
442
|
-
@
|
447
|
+
\e[1m\e[33m @sferik\e[0m
|
448
|
+
@episod @twitterapi now https://t.co/I17jUTu2 and https://t.co/deDu4Hgw seem
|
449
|
+
to be missing "1.1" from the URL.
|
443
450
|
|
444
|
-
\e[1m\e[33m @
|
445
|
-
@
|
451
|
+
\e[1m\e[33m @sferik\e[0m
|
452
|
+
@episod @twitterapi Did you catch https://t.co/VHsQvZT0 as well?
|
446
453
|
|
447
|
-
\e[1m\e[33m @
|
448
|
-
|
449
|
-
|
454
|
+
\e[1m\e[33m @dwiskus\e[0m
|
455
|
+
Gentlemen, you can't fight in here! This is the war room!
|
456
|
+
http://t.co/kMxMYyqF
|
450
457
|
|
451
458
|
eos
|
452
459
|
end
|
@@ -458,26 +465,26 @@ ID Since Last tweeted at Tweets Favorites Listed Following...
|
|
458
465
|
@list.timeline("presidents")
|
459
466
|
$stdout.string.should == <<-eos
|
460
467
|
ID,Posted at,Screen name,Text
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
468
|
+
244111636544225280,2012-09-07 16:35:24 +0000,mutgoff,Happy Birthday @imdane. Watch out for those @rally pranksters!
|
469
|
+
244111183165157376,2012-09-07 16:33:36 +0000,ironicsans,"If you like good real-life stories, check out @NarrativelyNY's just-launched site http://t.co/wiUL07jE (and also visit http://t.co/ZoyQxqWA)"
|
470
|
+
244110336414859264,2012-09-07 16:30:14 +0000,pat_shaughnessy,"Something else to vote for: ""New Rails workshops to bring more women into the Boston software scene"" http://t.co/eNBuckHc /cc @bostonrb"
|
471
|
+
244109797308379136,2012-09-07 16:28:05 +0000,calebelston,Pushing the button to launch the site. http://t.co/qLoEn5jG
|
472
|
+
244108728834592770,2012-09-07 16:23:50 +0000,calebelston,RT @olivercameron: Mosaic looks cool: http://t.co/A8013C9k
|
473
|
+
244107890632294400,2012-09-07 16:20:31 +0000,fivethirtyeight,"The Weatherman is Not a Moron: http://t.co/ZwL5Gnq5. An excerpt from my book, THE SIGNAL AND THE NOISE (http://t.co/fNXj8vCE)"
|
474
|
+
244107823733174272,2012-09-07 16:20:15 +0000,codeforamerica,"RT @randomhacks: Going to Code Across Austin II: Y'all Come Hack Now, Sat, Sep 8 http://t.co/Sk5BM7U3 We'll see y'all there! #rhok @codeforamerica @TheaClay"
|
475
|
+
244107236262170624,2012-09-07 16:17:55 +0000,fbjork,"RT @jondot: Just published: ""Pragmatic Concurrency With #Ruby"" http://t.co/kGEykswZ /cc @JRuby @headius"
|
476
|
+
244106476048764928,2012-09-07 16:14:53 +0000,mbostock,If you are wondering how we computed the split bubbles: http://t.co/BcaqSs5u
|
477
|
+
244105599351148544,2012-09-07 16:11:24 +0000,FakeDorsey,“Write drunk. Edit sober.”—Ernest Hemingway
|
478
|
+
244104558433951744,2012-09-07 16:07:16 +0000,al3x,"RT @wcmaier: Better banking through better ops: build something new with us @Simplify (remote, PDX) http://t.co/8WgzKZH3"
|
479
|
+
244104146997870594,2012-09-07 16:05:38 +0000,calebelston,"We just announced Mosaic, what we've been working on since the Yobongo acquisition. My personal post, http://t.co/ELOyIRZU @heymosaic"
|
480
|
+
244103057175113729,2012-09-07 16:01:18 +0000,BarackObama,Donate $10 or more --> get your favorite car magnet: http://t.co/NfRhl2s2 #Obama2012
|
481
|
+
244102834398851073,2012-09-07 16:00:25 +0000,JEG2,"RT @tenderlove: If corporations are people, can we use them to drive in the carpool lane?"
|
482
|
+
244102741125890048,2012-09-07 16:00:03 +0000,eveningedition,LDN—Obama's nomination; Putin woos APEC; Bombs hit Damascus; Quakes shake China; Canada cuts Iran ties; weekend read: http://t.co/OFs6dVW4
|
483
|
+
244102729860009984,2012-09-07 16:00:00 +0000,dhh,RT @ggreenwald: Democrats parade Osama bin Laden's corpse as their proudest achievement: why this goulish jingoism is so warped http://t.co/kood278s
|
484
|
+
244102490646278146,2012-09-07 15:59:03 +0000,jasonfried,"The story of Mars Curiosity's gears, made by a factory in Rockford, IL: http://t.co/MwCRsHQg"
|
485
|
+
244102209942458368,2012-09-07 15:57:56 +0000,sferik,"@episod @twitterapi now https://t.co/I17jUTu2 and https://t.co/deDu4Hgw seem to be missing ""1.1"" from the URL."
|
486
|
+
244100411563339777,2012-09-07 15:50:47 +0000,sferik,@episod @twitterapi Did you catch https://t.co/VHsQvZT0 as well?
|
487
|
+
244099460672679938,2012-09-07 15:47:01 +0000,dwiskus,"Gentlemen, you can't fight in here! This is the war room! http://t.co/kMxMYyqF"
|
481
488
|
eos
|
482
489
|
end
|
483
490
|
end
|
@@ -488,27 +495,27 @@ ID,Posted at,Screen name,Text
|
|
488
495
|
it "should output in long format" do
|
489
496
|
@list.timeline("presidents")
|
490
497
|
$stdout.string.should == <<-eos
|
491
|
-
ID Posted at Screen name
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
498
|
+
ID Posted at Screen name Text
|
499
|
+
244111636544225280 Sep 7 08:35 @mutgoff Happy Birthday @imdane. W...
|
500
|
+
244111183165157376 Sep 7 08:33 @ironicsans If you like good real-lif...
|
501
|
+
244110336414859264 Sep 7 08:30 @pat_shaughnessy Something else to vote fo...
|
502
|
+
244109797308379136 Sep 7 08:28 @calebelston Pushing the button to lau...
|
503
|
+
244108728834592770 Sep 7 08:23 @calebelston RT @olivercameron: Mosaic...
|
504
|
+
244107890632294400 Sep 7 08:20 @fivethirtyeight The Weatherman is Not a M...
|
505
|
+
244107823733174272 Sep 7 08:20 @codeforamerica RT @randomhacks: Going to...
|
506
|
+
244107236262170624 Sep 7 08:17 @fbjork RT @jondot: Just publishe...
|
507
|
+
244106476048764928 Sep 7 08:14 @mbostock If you are wondering how ...
|
508
|
+
244105599351148544 Sep 7 08:11 @FakeDorsey “Write drunk. Edit sober....
|
509
|
+
244104558433951744 Sep 7 08:07 @al3x RT @wcmaier: Better banki...
|
510
|
+
244104146997870594 Sep 7 08:05 @calebelston We just announced Mosaic,...
|
511
|
+
244103057175113729 Sep 7 08:01 @BarackObama Donate $10 or more --> ge...
|
512
|
+
244102834398851073 Sep 7 08:00 @JEG2 RT @tenderlove: If corpor...
|
513
|
+
244102741125890048 Sep 7 08:00 @eveningedition LDN—Obama's nomination; P...
|
514
|
+
244102729860009984 Sep 7 08:00 @dhh RT @ggreenwald: Democrats...
|
515
|
+
244102490646278146 Sep 7 07:59 @jasonfried The story of Mars Curiosi...
|
516
|
+
244102209942458368 Sep 7 07:57 @sferik @episod @twitterapi now h...
|
517
|
+
244100411563339777 Sep 7 07:50 @sferik @episod @twitterapi Did y...
|
518
|
+
244099460672679938 Sep 7 07:47 @dwiskus Gentlemen, you can't figh...
|
512
519
|
eos
|
513
520
|
end
|
514
521
|
context "--reverse" do
|
@@ -518,67 +525,67 @@ ID Posted at Screen name Text
|
|
518
525
|
it "should reverse the order of the sort" do
|
519
526
|
@list.timeline("presidents")
|
520
527
|
$stdout.string.should == <<-eos
|
521
|
-
ID Posted at Screen name
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
528
|
+
ID Posted at Screen name Text
|
529
|
+
244099460672679938 Sep 7 07:47 @dwiskus Gentlemen, you can't figh...
|
530
|
+
244100411563339777 Sep 7 07:50 @sferik @episod @twitterapi Did y...
|
531
|
+
244102209942458368 Sep 7 07:57 @sferik @episod @twitterapi now h...
|
532
|
+
244102490646278146 Sep 7 07:59 @jasonfried The story of Mars Curiosi...
|
533
|
+
244102729860009984 Sep 7 08:00 @dhh RT @ggreenwald: Democrats...
|
534
|
+
244102741125890048 Sep 7 08:00 @eveningedition LDN—Obama's nomination; P...
|
535
|
+
244102834398851073 Sep 7 08:00 @JEG2 RT @tenderlove: If corpor...
|
536
|
+
244103057175113729 Sep 7 08:01 @BarackObama Donate $10 or more --> ge...
|
537
|
+
244104146997870594 Sep 7 08:05 @calebelston We just announced Mosaic,...
|
538
|
+
244104558433951744 Sep 7 08:07 @al3x RT @wcmaier: Better banki...
|
539
|
+
244105599351148544 Sep 7 08:11 @FakeDorsey “Write drunk. Edit sober....
|
540
|
+
244106476048764928 Sep 7 08:14 @mbostock If you are wondering how ...
|
541
|
+
244107236262170624 Sep 7 08:17 @fbjork RT @jondot: Just publishe...
|
542
|
+
244107823733174272 Sep 7 08:20 @codeforamerica RT @randomhacks: Going to...
|
543
|
+
244107890632294400 Sep 7 08:20 @fivethirtyeight The Weatherman is Not a M...
|
544
|
+
244108728834592770 Sep 7 08:23 @calebelston RT @olivercameron: Mosaic...
|
545
|
+
244109797308379136 Sep 7 08:28 @calebelston Pushing the button to lau...
|
546
|
+
244110336414859264 Sep 7 08:30 @pat_shaughnessy Something else to vote fo...
|
547
|
+
244111183165157376 Sep 7 08:33 @ironicsans If you like good real-lif...
|
548
|
+
244111636544225280 Sep 7 08:35 @mutgoff Happy Birthday @imdane. W...
|
542
549
|
eos
|
543
550
|
end
|
544
551
|
end
|
545
552
|
end
|
546
553
|
context "--number" do
|
547
554
|
before do
|
548
|
-
stub_get("/1/lists/statuses.json").
|
555
|
+
stub_get("/1.1/lists/statuses.json").
|
549
556
|
with(:query => {:owner_screen_name => "testcli", :per_page => "1", :slug => "presidents"}).
|
550
557
|
to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
551
|
-
stub_get("/1/lists/statuses.json").
|
558
|
+
stub_get("/1.1/lists/statuses.json").
|
552
559
|
with(:query => {:owner_screen_name => "testcli", :per_page => "200", :slug => "presidents"}).
|
553
560
|
to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
554
|
-
stub_get("/1/lists/statuses.json").
|
555
|
-
with(:query => {:owner_screen_name => "testcli", :per_page => "200", :max_id => "
|
561
|
+
stub_get("/1.1/lists/statuses.json").
|
562
|
+
with(:query => {:owner_screen_name => "testcli", :per_page => "200", :max_id => "244099460672679937", :slug => "presidents"}).
|
556
563
|
to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
557
564
|
(5..185).step(20).to_a.reverse.each do |count|
|
558
|
-
stub_get("/1/lists/statuses.json").
|
559
|
-
with(:query => {:owner_screen_name => "testcli", :per_page => count, :max_id => "
|
565
|
+
stub_get("/1.1/lists/statuses.json").
|
566
|
+
with(:query => {:owner_screen_name => "testcli", :per_page => count, :max_id => "244099460672679937", :slug => "presidents"}).
|
560
567
|
to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
561
568
|
end
|
562
569
|
end
|
563
570
|
it "should limit the number of results to 1" do
|
564
571
|
@list.options = @list.options.merge("number" => 1)
|
565
572
|
@list.timeline("presidents")
|
566
|
-
a_get("/1/lists/statuses.json").
|
573
|
+
a_get("/1.1/lists/statuses.json").
|
567
574
|
with(:query => {:owner_screen_name => "testcli", :per_page => "1", :slug => "presidents"}).
|
568
575
|
should have_been_made
|
569
576
|
end
|
570
577
|
it "should limit the number of results to 345" do
|
571
578
|
@list.options = @list.options.merge("number" => 345)
|
572
579
|
@list.timeline("presidents")
|
573
|
-
a_get("/1/lists/statuses.json").
|
580
|
+
a_get("/1.1/lists/statuses.json").
|
574
581
|
with(:query => {:owner_screen_name => "testcli", :per_page => "200", :slug => "presidents"}).
|
575
582
|
should have_been_made
|
576
|
-
a_get("/1/lists/statuses.json").
|
577
|
-
with(:query => {:owner_screen_name => "testcli", :per_page => "200", :max_id => "
|
583
|
+
a_get("/1.1/lists/statuses.json").
|
584
|
+
with(:query => {:owner_screen_name => "testcli", :per_page => "200", :max_id => "244099460672679937", :slug => "presidents"}).
|
578
585
|
should have_been_made.times(7)
|
579
586
|
(5..185).step(20).to_a.reverse.each do |count|
|
580
|
-
a_get("/1/lists/statuses.json").
|
581
|
-
with(:query => {:owner_screen_name => "testcli", :per_page => count, :max_id => "
|
587
|
+
a_get("/1.1/lists/statuses.json").
|
588
|
+
with(:query => {:owner_screen_name => "testcli", :per_page => count, :max_id => "244099460672679937", :slug => "presidents"}).
|
582
589
|
should have_been_made
|
583
590
|
end
|
584
591
|
end
|
@@ -586,20 +593,20 @@ ID Posted at Screen name Text
|
|
586
593
|
context "with a user passed" do
|
587
594
|
it "should request the correct resource" do
|
588
595
|
@list.timeline("testcli/presidents")
|
589
|
-
a_get("/1/lists/statuses.json").
|
596
|
+
a_get("/1.1/lists/statuses.json").
|
590
597
|
with(:query => {:owner_screen_name => "testcli", :per_page => "20", :slug => "presidents"}).
|
591
598
|
should have_been_made
|
592
599
|
end
|
593
600
|
context "--id" do
|
594
601
|
before do
|
595
602
|
@list.options = @list.options.merge("id" => true)
|
596
|
-
stub_get("/1/lists/statuses.json").
|
603
|
+
stub_get("/1.1/lists/statuses.json").
|
597
604
|
with(:query => {:owner_id => "7505382", :per_page => "20", :slug => "presidents"}).
|
598
605
|
to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
599
606
|
end
|
600
607
|
it "should request the correct resource" do
|
601
608
|
@list.timeline("7505382/presidents")
|
602
|
-
a_get("/1/lists/statuses.json").
|
609
|
+
a_get("/1.1/lists/statuses.json").
|
603
610
|
with(:query => {:owner_id => "7505382", :per_page => "20", :slug => "presidents"}).
|
604
611
|
should have_been_made
|
605
612
|
end
|