t 1.1.1 → 1.2.0
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/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/lib/t/stream.rb
CHANGED
@@ -35,16 +35,16 @@ module T
|
|
35
35
|
print_table([headings])
|
36
36
|
end
|
37
37
|
end
|
38
|
-
client.on_timeline_status do |
|
38
|
+
client.on_timeline_status do |tweet|
|
39
39
|
if options['csv']
|
40
|
-
|
40
|
+
print_csv_tweet(tweet)
|
41
41
|
elsif options['long']
|
42
|
-
array =
|
42
|
+
array = build_long_tweet(tweet).each_with_index.map do |element, index|
|
43
43
|
STATUS_HEADINGS_FORMATTING[index] % element
|
44
44
|
end
|
45
45
|
print_table([array], :truncate => STDOUT.tty?)
|
46
46
|
else
|
47
|
-
print_message(
|
47
|
+
print_message(tweet.user.screen_name, tweet.text)
|
48
48
|
end
|
49
49
|
end
|
50
50
|
client.sample
|
@@ -53,8 +53,8 @@ module T
|
|
53
53
|
desc "matrix", "Unfortunately, no one can be told what the Matrix is. You have to see it for yourself."
|
54
54
|
def matrix
|
55
55
|
require 'tweetstream'
|
56
|
-
client.on_timeline_status do |
|
57
|
-
say(
|
56
|
+
client.on_timeline_status do |tweet|
|
57
|
+
say(tweet.full_text.gsub("\n", ''), [:bold, :green, :on_black])
|
58
58
|
end
|
59
59
|
client.sample
|
60
60
|
end
|
@@ -73,16 +73,16 @@ module T
|
|
73
73
|
search.options = search.options.merge(:format => STATUS_HEADINGS_FORMATTING)
|
74
74
|
search.all(keywords.join(' OR '))
|
75
75
|
end
|
76
|
-
client.on_timeline_status do |
|
76
|
+
client.on_timeline_status do |tweet|
|
77
77
|
if options['csv']
|
78
|
-
|
78
|
+
print_csv_tweet(tweet)
|
79
79
|
elsif options['long']
|
80
|
-
array =
|
80
|
+
array = build_long_tweet(tweet).each_with_index.map do |element, index|
|
81
81
|
STATUS_HEADINGS_FORMATTING[index] % element
|
82
82
|
end
|
83
83
|
print_table([array], :truncate => STDOUT.tty?)
|
84
84
|
else
|
85
|
-
print_message(
|
85
|
+
print_message(tweet.user.screen_name, tweet.text)
|
86
86
|
end
|
87
87
|
end
|
88
88
|
client.track(keywords)
|
@@ -101,16 +101,16 @@ module T
|
|
101
101
|
cli.options = cli.options.merge(:format => STATUS_HEADINGS_FORMATTING)
|
102
102
|
cli.timeline
|
103
103
|
end
|
104
|
-
client.on_timeline_status do |
|
104
|
+
client.on_timeline_status do |tweet|
|
105
105
|
if options['csv']
|
106
|
-
|
106
|
+
print_csv_tweet(tweet)
|
107
107
|
elsif options['long']
|
108
|
-
array =
|
108
|
+
array = build_long_tweet(tweet).each_with_index.map do |element, index|
|
109
109
|
STATUS_HEADINGS_FORMATTING[index] % element
|
110
110
|
end
|
111
111
|
print_table([array], :truncate => STDOUT.tty?)
|
112
112
|
else
|
113
|
-
print_message(
|
113
|
+
print_message(tweet.user.screen_name, tweet.text)
|
114
114
|
end
|
115
115
|
end
|
116
116
|
client.userstream
|
@@ -135,16 +135,16 @@ module T
|
|
135
135
|
print_table([headings])
|
136
136
|
end
|
137
137
|
end
|
138
|
-
client.on_timeline_status do |
|
138
|
+
client.on_timeline_status do |tweet|
|
139
139
|
if options['csv']
|
140
|
-
|
140
|
+
print_csv_tweet(tweet)
|
141
141
|
elsif options['long']
|
142
|
-
array =
|
142
|
+
array = build_long_tweet(tweet).each_with_index.map do |element, index|
|
143
143
|
STATUS_HEADINGS_FORMATTING[index] % element
|
144
144
|
end
|
145
145
|
print_table([array], :truncate => STDOUT.tty?)
|
146
146
|
else
|
147
|
-
print_message(
|
147
|
+
print_message(tweet.user.screen_name, tweet.text)
|
148
148
|
end
|
149
149
|
end
|
150
150
|
client.follow(user_ids)
|
data/lib/t/version.rb
CHANGED
data/spec/cli_spec.rb
CHANGED
@@ -90,13 +90,13 @@ testcli
|
|
90
90
|
describe "#block" do
|
91
91
|
before do
|
92
92
|
@cli.options = @cli.options.merge("profile" => fixture_path + "/.trc")
|
93
|
-
stub_post("/1/blocks/create.json").
|
93
|
+
stub_post("/1.1/blocks/create.json").
|
94
94
|
with(:body => {:screen_name => "sferik"}).
|
95
95
|
to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
96
96
|
end
|
97
97
|
it "should request the correct resource" do
|
98
98
|
@cli.block("sferik")
|
99
|
-
a_post("/1/blocks/create.json").
|
99
|
+
a_post("/1.1/blocks/create.json").
|
100
100
|
with(:body => {:screen_name => "sferik"}).
|
101
101
|
should have_been_made
|
102
102
|
end
|
@@ -107,13 +107,13 @@ testcli
|
|
107
107
|
context "--id" do
|
108
108
|
before do
|
109
109
|
@cli.options = @cli.options.merge("id" => true)
|
110
|
-
stub_post("/1/blocks/create.json").
|
110
|
+
stub_post("/1.1/blocks/create.json").
|
111
111
|
with(:body => {:user_id => "7505382"}).
|
112
112
|
to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
113
113
|
end
|
114
114
|
it "should request the correct resource" do
|
115
115
|
@cli.block("7505382")
|
116
|
-
a_post("/1/blocks/create.json").
|
116
|
+
a_post("/1.1/blocks/create.json").
|
117
117
|
with(:body => {:user_id => "7505382"}).
|
118
118
|
should have_been_made
|
119
119
|
end
|
@@ -122,16 +122,16 @@ testcli
|
|
122
122
|
|
123
123
|
describe "#direct_messages" do
|
124
124
|
before do
|
125
|
-
stub_get("/1/direct_messages.json").
|
125
|
+
stub_get("/1.1/direct_messages.json").
|
126
126
|
with(:query => {:count => "20"}).
|
127
127
|
to_return(:body => fixture("direct_messages.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
128
|
-
stub_get("/1/direct_messages.json").
|
128
|
+
stub_get("/1.1/direct_messages.json").
|
129
129
|
with(:query => {:count => "10", "max_id"=>"1624782205"}).
|
130
130
|
to_return(:body => fixture("empty_array.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
131
131
|
end
|
132
132
|
it "should request the correct resource" do
|
133
133
|
@cli.direct_messages
|
134
|
-
a_get("/1/direct_messages.json").
|
134
|
+
a_get("/1.1/direct_messages.json").
|
135
135
|
with(:query => {:count => "20"}).
|
136
136
|
should have_been_made
|
137
137
|
end
|
@@ -220,17 +220,17 @@ ID Posted at Screen name Text
|
|
220
220
|
end
|
221
221
|
context "--number" do
|
222
222
|
before do
|
223
|
-
stub_get("/1/direct_messages.json").
|
223
|
+
stub_get("/1.1/direct_messages.json").
|
224
224
|
with(:query => {:count => "1"}).
|
225
225
|
to_return(:body => fixture("direct_messages.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
226
|
-
stub_get("/1/direct_messages.json").
|
226
|
+
stub_get("/1.1/direct_messages.json").
|
227
227
|
with(:query => {:count => "200"}).
|
228
228
|
to_return(:body => fixture("direct_messages.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
229
|
-
stub_get("/1/direct_messages.json").
|
229
|
+
stub_get("/1.1/direct_messages.json").
|
230
230
|
with(:query => {:count => "200", :max_id => "1624782205"}).
|
231
231
|
to_return(:body => fixture("direct_messages.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
232
232
|
(5..195).step(10).to_a.reverse.each do |count|
|
233
|
-
stub_get("/1/direct_messages.json").
|
233
|
+
stub_get("/1.1/direct_messages.json").
|
234
234
|
with(:query => {:count => count, :max_id => "1624782205"}).
|
235
235
|
to_return(:body => fixture("direct_messages.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
236
236
|
end
|
@@ -238,21 +238,21 @@ ID Posted at Screen name Text
|
|
238
238
|
it "should limit the number of results to 1" do
|
239
239
|
@cli.options = @cli.options.merge("number" => 1)
|
240
240
|
@cli.direct_messages
|
241
|
-
a_get("/1/direct_messages.json").
|
241
|
+
a_get("/1.1/direct_messages.json").
|
242
242
|
with(:query => {:count => "1"}).
|
243
243
|
should have_been_made
|
244
244
|
end
|
245
245
|
it "should limit the number of results to 345" do
|
246
246
|
@cli.options = @cli.options.merge("number" => 345)
|
247
247
|
@cli.direct_messages
|
248
|
-
a_get("/1/direct_messages.json").
|
248
|
+
a_get("/1.1/direct_messages.json").
|
249
249
|
with(:query => {:count => "200"}).
|
250
250
|
should have_been_made
|
251
|
-
a_get("/1/direct_messages.json").
|
251
|
+
a_get("/1.1/direct_messages.json").
|
252
252
|
with(:query => {:count => "200", :max_id => "1624782205"}).
|
253
253
|
should have_been_made.times(14)
|
254
254
|
(5..195).step(10).to_a.reverse.each do |count|
|
255
|
-
a_get("/1/direct_messages.json").
|
255
|
+
a_get("/1.1/direct_messages.json").
|
256
256
|
with(:query => {:count => count, :max_id => "1624782205"}).
|
257
257
|
should have_been_made
|
258
258
|
end
|
@@ -308,16 +308,16 @@ ID Posted at Screen name Text
|
|
308
308
|
|
309
309
|
describe "#direct_messages_sent" do
|
310
310
|
before do
|
311
|
-
stub_get("/1/direct_messages/sent.json").
|
311
|
+
stub_get("/1.1/direct_messages/sent.json").
|
312
312
|
with(:query => {:count => "20"}).
|
313
313
|
to_return(:body => fixture("direct_messages.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
314
|
-
stub_get("/1/direct_messages/sent.json").
|
314
|
+
stub_get("/1.1/direct_messages/sent.json").
|
315
315
|
with(:query => {:count => "10", "max_id"=>"1624782205"}).
|
316
316
|
to_return(:body => fixture("empty_array.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
317
317
|
end
|
318
318
|
it "should request the correct resource" do
|
319
319
|
@cli.direct_messages_sent
|
320
|
-
a_get("/1/direct_messages/sent.json").
|
320
|
+
a_get("/1.1/direct_messages/sent.json").
|
321
321
|
with(:query => {:count => "20"}).
|
322
322
|
should have_been_made
|
323
323
|
end
|
@@ -406,17 +406,17 @@ ID Posted at Screen name Text
|
|
406
406
|
end
|
407
407
|
context "--number" do
|
408
408
|
before do
|
409
|
-
stub_get("/1/direct_messages/sent.json").
|
409
|
+
stub_get("/1.1/direct_messages/sent.json").
|
410
410
|
with(:query => {:count => "1"}).
|
411
411
|
to_return(:body => fixture("direct_messages.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
412
|
-
stub_get("/1/direct_messages/sent.json").
|
412
|
+
stub_get("/1.1/direct_messages/sent.json").
|
413
413
|
with(:query => {:count => "200"}).
|
414
414
|
to_return(:body => fixture("direct_messages.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
415
|
-
stub_get("/1/direct_messages/sent.json").
|
415
|
+
stub_get("/1.1/direct_messages/sent.json").
|
416
416
|
with(:query => {:count => "200", :max_id => "1624782205"}).
|
417
417
|
to_return(:body => fixture("direct_messages.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
418
418
|
(5..195).step(10).to_a.reverse.each do |count|
|
419
|
-
stub_get("/1/direct_messages/sent.json").
|
419
|
+
stub_get("/1.1/direct_messages/sent.json").
|
420
420
|
with(:query => {:count => count, :max_id => "1624782205"}).
|
421
421
|
to_return(:body => fixture("direct_messages.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
422
422
|
end
|
@@ -424,21 +424,21 @@ ID Posted at Screen name Text
|
|
424
424
|
it "should limit the number of results 1" do
|
425
425
|
@cli.options = @cli.options.merge("number" => 1)
|
426
426
|
@cli.direct_messages_sent
|
427
|
-
a_get("/1/direct_messages/sent.json").
|
427
|
+
a_get("/1.1/direct_messages/sent.json").
|
428
428
|
with(:query => {:count => "1"}).
|
429
429
|
should have_been_made
|
430
430
|
end
|
431
431
|
it "should limit the number of results to 345" do
|
432
432
|
@cli.options = @cli.options.merge("number" => 345)
|
433
433
|
@cli.direct_messages_sent
|
434
|
-
a_get("/1/direct_messages/sent.json").
|
434
|
+
a_get("/1.1/direct_messages/sent.json").
|
435
435
|
with(:query => {:count => "200"}).
|
436
436
|
should have_been_made
|
437
|
-
a_get("/1/direct_messages/sent.json").
|
437
|
+
a_get("/1.1/direct_messages/sent.json").
|
438
438
|
with(:query => {:count => "200", :max_id => "1624782205"}).
|
439
439
|
should have_been_made.times(14)
|
440
440
|
(5..195).step(10).to_a.reverse.each do |count|
|
441
|
-
a_get("/1/direct_messages/sent.json").
|
441
|
+
a_get("/1.1/direct_messages/sent.json").
|
442
442
|
with(:query => {:count => count, :max_id => "1624782205"}).
|
443
443
|
should have_been_made
|
444
444
|
end
|
@@ -494,26 +494,26 @@ ID Posted at Screen name Text
|
|
494
494
|
|
495
495
|
describe "#groupies" do
|
496
496
|
before do
|
497
|
-
stub_get("/1/followers/ids.json").
|
497
|
+
stub_get("/1.1/followers/ids.json").
|
498
498
|
with(:query => {:cursor => "-1"}).
|
499
499
|
to_return(:body => fixture("followers_ids.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
500
|
-
stub_get("/1/friends/ids.json").
|
500
|
+
stub_get("/1.1/friends/ids.json").
|
501
501
|
with(:query => {:cursor => "-1"}).
|
502
502
|
to_return(:body => fixture("friends_ids.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
503
|
-
|
504
|
-
with(:
|
503
|
+
stub_post("/1.1/users/lookup.json").
|
504
|
+
with(:body => {:user_id => "213747670,428004849"}).
|
505
505
|
to_return(:body => fixture("users.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
506
506
|
end
|
507
507
|
it "should request the correct resource" do
|
508
508
|
@cli.groupies
|
509
|
-
a_get("/1/followers/ids.json").
|
509
|
+
a_get("/1.1/followers/ids.json").
|
510
510
|
with(:query => {:cursor => "-1"}).
|
511
511
|
should have_been_made
|
512
|
-
a_get("/1/friends/ids.json").
|
512
|
+
a_get("/1.1/friends/ids.json").
|
513
513
|
with(:query => {:cursor => "-1"}).
|
514
514
|
should have_been_made
|
515
|
-
|
516
|
-
with(:
|
515
|
+
a_post("/1.1/users/lookup.json").
|
516
|
+
with(:body => {:user_id => "213747670,428004849"}).
|
517
517
|
should have_been_made
|
518
518
|
end
|
519
519
|
it "should have the correct output" do
|
@@ -629,45 +629,45 @@ ID Since Last tweeted at Tweets Favorites Listed Following...
|
|
629
629
|
end
|
630
630
|
context "with a user passed" do
|
631
631
|
before do
|
632
|
-
stub_get("/1/followers/ids.json").
|
632
|
+
stub_get("/1.1/followers/ids.json").
|
633
633
|
with(:query => {:cursor => "-1", :screen_name => "sferik"}).
|
634
634
|
to_return(:body => fixture("followers_ids.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
635
|
-
stub_get("/1/friends/ids.json").
|
635
|
+
stub_get("/1.1/friends/ids.json").
|
636
636
|
with(:query => {:cursor => "-1", :screen_name => "sferik"}).
|
637
637
|
to_return(:body => fixture("friends_ids.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
638
638
|
end
|
639
639
|
it "should request the correct resource" do
|
640
640
|
@cli.groupies("sferik")
|
641
|
-
a_get("/1/followers/ids.json").
|
641
|
+
a_get("/1.1/followers/ids.json").
|
642
642
|
with(:query => {:cursor => "-1", :screen_name => "sferik"}).
|
643
643
|
should have_been_made
|
644
|
-
a_get("/1/friends/ids.json").
|
644
|
+
a_get("/1.1/friends/ids.json").
|
645
645
|
with(:query => {:cursor => "-1", :screen_name => "sferik"}).
|
646
646
|
should have_been_made
|
647
|
-
|
648
|
-
with(:
|
647
|
+
a_post("/1.1/users/lookup.json").
|
648
|
+
with(:body => {:user_id => "213747670,428004849"}).
|
649
649
|
should have_been_made
|
650
650
|
end
|
651
651
|
context "--id" do
|
652
652
|
before do
|
653
653
|
@cli.options = @cli.options.merge("id" => true)
|
654
|
-
stub_get("/1/followers/ids.json").
|
654
|
+
stub_get("/1.1/followers/ids.json").
|
655
655
|
with(:query => {:cursor => "-1", :user_id => "7505382"}).
|
656
656
|
to_return(:body => fixture("followers_ids.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
657
|
-
stub_get("/1/friends/ids.json").
|
657
|
+
stub_get("/1.1/friends/ids.json").
|
658
658
|
with(:query => {:cursor => "-1", :user_id => "7505382"}).
|
659
659
|
to_return(:body => fixture("friends_ids.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
660
660
|
end
|
661
661
|
it "should request the correct resource" do
|
662
662
|
@cli.groupies("7505382")
|
663
|
-
a_get("/1/followers/ids.json").
|
663
|
+
a_get("/1.1/followers/ids.json").
|
664
664
|
with(:query => {:cursor => "-1", :user_id => "7505382"}).
|
665
665
|
should have_been_made
|
666
|
-
a_get("/1/friends/ids.json").
|
666
|
+
a_get("/1.1/friends/ids.json").
|
667
667
|
with(:query => {:cursor => "-1", :user_id => "7505382"}).
|
668
668
|
should have_been_made
|
669
|
-
|
670
|
-
with(:
|
669
|
+
a_post("/1.1/users/lookup.json").
|
670
|
+
with(:body => {:user_id => "213747670,428004849"}).
|
671
671
|
should have_been_made
|
672
672
|
end
|
673
673
|
end
|
@@ -677,13 +677,13 @@ ID Since Last tweeted at Tweets Favorites Listed Following...
|
|
677
677
|
describe "#dm" do
|
678
678
|
before do
|
679
679
|
@cli.options = @cli.options.merge("profile" => fixture_path + "/.trc")
|
680
|
-
stub_post("/1/direct_messages/new.json").
|
680
|
+
stub_post("/1.1/direct_messages/new.json").
|
681
681
|
with(:body => {:screen_name => "pengwynn", :text => "Creating a fixture for the Twitter gem"}).
|
682
682
|
to_return(:body => fixture("direct_message.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
683
683
|
end
|
684
684
|
it "should request the correct resource" do
|
685
685
|
@cli.dm("pengwynn", "Creating a fixture for the Twitter gem")
|
686
|
-
a_post("/1/direct_messages/new.json").
|
686
|
+
a_post("/1.1/direct_messages/new.json").
|
687
687
|
with(:body => {:screen_name => "pengwynn", :text => "Creating a fixture for the Twitter gem"}).
|
688
688
|
should have_been_made
|
689
689
|
end
|
@@ -694,13 +694,13 @@ ID Since Last tweeted at Tweets Favorites Listed Following...
|
|
694
694
|
context "--id" do
|
695
695
|
before do
|
696
696
|
@cli.options = @cli.options.merge("id" => true)
|
697
|
-
stub_post("/1/direct_messages/new.json").
|
697
|
+
stub_post("/1.1/direct_messages/new.json").
|
698
698
|
with(:body => {:user_id => "14100886", :text => "Creating a fixture for the Twitter gem"}).
|
699
699
|
to_return(:body => fixture("direct_message.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
700
700
|
end
|
701
701
|
it "should request the correct resource" do
|
702
702
|
@cli.dm("14100886", "Creating a fixture for the Twitter gem")
|
703
|
-
a_post("/1/direct_messages/new.json").
|
703
|
+
a_post("/1.1/direct_messages/new.json").
|
704
704
|
with(:body => {:user_id => "14100886", :text => "Creating a fixture for the Twitter gem"}).
|
705
705
|
should have_been_made
|
706
706
|
end
|
@@ -710,13 +710,13 @@ ID Since Last tweeted at Tweets Favorites Listed Following...
|
|
710
710
|
describe "#does_contain" do
|
711
711
|
before do
|
712
712
|
@cli.options = @cli.options.merge("profile" => fixture_path + "/.trc")
|
713
|
-
stub_get("/1/lists/members/show.json").
|
713
|
+
stub_get("/1.1/lists/members/show.json").
|
714
714
|
with(:query => {:owner_screen_name => "testcli", :screen_name => "testcli", :slug => "presidents"}).
|
715
715
|
to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
716
716
|
end
|
717
717
|
it "should request the correct resource" do
|
718
718
|
@cli.does_contain("presidents")
|
719
|
-
a_get("/1/lists/members/show.json").
|
719
|
+
a_get("/1.1/lists/members/show.json").
|
720
720
|
with(:query => {:owner_screen_name => "testcli", :screen_name => "testcli", :slug => "presidents"}).
|
721
721
|
should have_been_made
|
722
722
|
end
|
@@ -727,19 +727,19 @@ ID Since Last tweeted at Tweets Favorites Listed Following...
|
|
727
727
|
context "--id" do
|
728
728
|
before do
|
729
729
|
@cli.options = @cli.options.merge("id" => true)
|
730
|
-
stub_get("/1/users/show.json").
|
730
|
+
stub_get("/1.1/users/show.json").
|
731
731
|
with(:query => {:user_id => "7505382"}).
|
732
732
|
to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
733
|
-
stub_get("/1/lists/members/show.json").
|
733
|
+
stub_get("/1.1/lists/members/show.json").
|
734
734
|
with(:query => {:owner_screen_name => "testcli", :screen_name => "sferik", :slug => "presidents"}).
|
735
735
|
to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
736
736
|
end
|
737
737
|
it "should request the correct resource" do
|
738
738
|
@cli.does_contain("presidents", "7505382")
|
739
|
-
a_get("/1/users/show.json").
|
739
|
+
a_get("/1.1/users/show.json").
|
740
740
|
with(:query => {:user_id => "7505382"}).
|
741
741
|
should have_been_made
|
742
|
-
a_get("/1/lists/members/show.json").
|
742
|
+
a_get("/1.1/lists/members/show.json").
|
743
743
|
with(:query => {:owner_screen_name => "testcli", :screen_name => "sferik", :slug => "presidents"}).
|
744
744
|
should have_been_made
|
745
745
|
end
|
@@ -752,19 +752,19 @@ ID Since Last tweeted at Tweets Favorites Listed Following...
|
|
752
752
|
context "--id" do
|
753
753
|
before do
|
754
754
|
@cli.options = @cli.options.merge("id" => true)
|
755
|
-
stub_get("/1/users/show.json").
|
755
|
+
stub_get("/1.1/users/show.json").
|
756
756
|
with(:query => {:user_id => "7505382"}).
|
757
757
|
to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
758
|
-
stub_get("/1/lists/members/show.json").
|
758
|
+
stub_get("/1.1/lists/members/show.json").
|
759
759
|
with(:query => {:owner_id => "7505382", :screen_name => "sferik", :slug => "presidents"}).
|
760
760
|
to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
761
761
|
end
|
762
762
|
it "should request the correct resource" do
|
763
763
|
@cli.does_contain("7505382/presidents", "7505382")
|
764
|
-
a_get("/1/users/show.json").
|
764
|
+
a_get("/1.1/users/show.json").
|
765
765
|
with(:query => {:user_id => "7505382"}).
|
766
766
|
should have_been_made
|
767
|
-
a_get("/1/lists/members/show.json").
|
767
|
+
a_get("/1.1/lists/members/show.json").
|
768
768
|
with(:query => {:owner_id => "7505382", :screen_name => "sferik", :slug => "presidents"}).
|
769
769
|
should have_been_made
|
770
770
|
end
|
@@ -778,7 +778,7 @@ ID Since Last tweeted at Tweets Favorites Listed Following...
|
|
778
778
|
end
|
779
779
|
context "false" do
|
780
780
|
before do
|
781
|
-
stub_get("/1/lists/members/show.json").
|
781
|
+
stub_get("/1.1/lists/members/show.json").
|
782
782
|
with(:query => {:owner_screen_name => "testcli", :screen_name => "testcli", :slug => "presidents"}).
|
783
783
|
to_return(:body => fixture("not_found.json"), :status => 404, :headers => {:content_type => "application/json; charset=utf-8"})
|
784
784
|
end
|
@@ -786,7 +786,7 @@ ID Since Last tweeted at Tweets Favorites Listed Following...
|
|
786
786
|
lambda do
|
787
787
|
@cli.does_contain("presidents")
|
788
788
|
end.should raise_error(SystemExit)
|
789
|
-
a_get("/1/lists/members/show.json").
|
789
|
+
a_get("/1.1/lists/members/show.json").
|
790
790
|
with(:query => {:owner_screen_name => "testcli", :screen_name => "testcli", :slug => "presidents"}).
|
791
791
|
should have_been_made
|
792
792
|
end
|
@@ -796,14 +796,14 @@ ID Since Last tweeted at Tweets Favorites Listed Following...
|
|
796
796
|
describe "#does_follow" do
|
797
797
|
before do
|
798
798
|
@cli.options = @cli.options.merge("profile" => fixture_path + "/.trc")
|
799
|
-
stub_get("/1/friendships/
|
800
|
-
with(:query => {:
|
801
|
-
to_return(:body => fixture("
|
799
|
+
stub_get("/1.1/friendships/show.json").
|
800
|
+
with(:query => {:source_screen_name => "ev", :target_screen_name => "testcli"}).
|
801
|
+
to_return(:body => fixture("following.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
802
802
|
end
|
803
803
|
it "should request the correct resource" do
|
804
804
|
@cli.does_follow("ev")
|
805
|
-
a_get("/1/friendships/
|
806
|
-
with(:query => {:
|
805
|
+
a_get("/1.1/friendships/show.json").
|
806
|
+
with(:query => {:source_screen_name => "ev", :target_screen_name => "testcli"}).
|
807
807
|
should have_been_made
|
808
808
|
end
|
809
809
|
it "should have the correct output" do
|
@@ -813,67 +813,73 @@ ID Since Last tweeted at Tweets Favorites Listed Following...
|
|
813
813
|
context "--id" do
|
814
814
|
before do
|
815
815
|
@cli.options = @cli.options.merge("id" => true)
|
816
|
-
stub_get("/1/users/show.json").
|
816
|
+
stub_get("/1.1/users/show.json").
|
817
817
|
with(:query => {:user_id => "20"}).
|
818
818
|
to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
819
|
-
stub_get("/1/friendships/
|
820
|
-
with(:query => {:
|
821
|
-
to_return(:body => fixture("
|
819
|
+
stub_get("/1.1/friendships/show.json").
|
820
|
+
with(:query => {:source_screen_name => "sferik", :target_screen_name => "testcli"}).
|
821
|
+
to_return(:body => fixture("following.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
822
822
|
end
|
823
823
|
it "should request the correct resource" do
|
824
824
|
@cli.does_follow("20")
|
825
|
-
a_get("/1/users/show.json").
|
825
|
+
a_get("/1.1/users/show.json").
|
826
826
|
with(:query => {:user_id => "20"}).
|
827
827
|
should have_been_made
|
828
|
-
a_get("/1/friendships/
|
829
|
-
with(:query => {:
|
828
|
+
a_get("/1.1/friendships/show.json").
|
829
|
+
with(:query => {:source_screen_name => "sferik", :target_screen_name => "testcli"}).
|
830
830
|
should have_been_made
|
831
831
|
end
|
832
832
|
end
|
833
833
|
context "with a user passed" do
|
834
|
+
before do
|
835
|
+
@cli.options = @cli.options.merge("id" => true)
|
836
|
+
stub_get("/1.1/users/show.json").
|
837
|
+
with(:query => {:user_id => "0"}).
|
838
|
+
to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
839
|
+
stub_get("/1.1/friendships/show.json").
|
840
|
+
with(:query => {:source_screen_name => "sferik", :target_screen_name => "sferik"}).
|
841
|
+
to_return(:body => fixture("following.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
842
|
+
end
|
834
843
|
it "should have the correct output" do
|
835
844
|
@cli.does_follow("ev", "testcli")
|
836
|
-
$stdout.string.chomp.should == "Yes, @
|
845
|
+
$stdout.string.chomp.should == "Yes, @sferik follows @sferik."
|
837
846
|
end
|
838
847
|
context "--id" do
|
839
848
|
before do
|
840
849
|
@cli.options = @cli.options.merge("id" => true)
|
841
|
-
stub_get("/1/users/show.json").
|
850
|
+
stub_get("/1.1/users/show.json").
|
842
851
|
with(:query => {:user_id => "20"}).
|
843
852
|
to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
844
|
-
stub_get("/1/users/show.json").
|
853
|
+
stub_get("/1.1/users/show.json").
|
845
854
|
with(:query => {:user_id => "428004849"}).
|
846
855
|
to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
847
|
-
stub_get("/1/friendships/exists.json").
|
848
|
-
with(:query => {:screen_name_a => "sferik", :screen_name_b => "sferik"}).
|
849
|
-
to_return(:body => fixture("true.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
850
856
|
end
|
851
857
|
it "should request the correct resource" do
|
852
858
|
@cli.does_follow("20", "428004849")
|
853
|
-
a_get("/1/users/show.json").
|
859
|
+
a_get("/1.1/users/show.json").
|
854
860
|
with(:query => {:user_id => "20"}).
|
855
861
|
should have_been_made
|
856
|
-
a_get("/1/users/show.json").
|
862
|
+
a_get("/1.1/users/show.json").
|
857
863
|
with(:query => {:user_id => "428004849"}).
|
858
864
|
should have_been_made
|
859
|
-
a_get("/1/friendships/
|
860
|
-
with(:query => {:
|
865
|
+
a_get("/1.1/friendships/show.json").
|
866
|
+
with(:query => {:source_screen_name => "sferik", :target_screen_name => "sferik"}).
|
861
867
|
should have_been_made
|
862
868
|
end
|
863
869
|
end
|
864
870
|
end
|
865
871
|
context "false" do
|
866
872
|
before do
|
867
|
-
stub_get("/1/friendships/
|
868
|
-
with(:query => {:
|
869
|
-
to_return(:body => fixture("
|
873
|
+
stub_get("/1.1/friendships/show.json").
|
874
|
+
with(:query => {:source_screen_name => "ev", :target_screen_name => "testcli"}).
|
875
|
+
to_return(:body => fixture("not_following.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
870
876
|
end
|
871
877
|
it "should exit" do
|
872
878
|
lambda do
|
873
879
|
@cli.does_follow("ev")
|
874
880
|
end.should raise_error(SystemExit)
|
875
|
-
a_get("/1/friendships/
|
876
|
-
with(:query => {:
|
881
|
+
a_get("/1.1/friendships/show.json").
|
882
|
+
with(:query => {:source_screen_name => "ev", :target_screen_name => "testcli"}).
|
877
883
|
should have_been_made
|
878
884
|
end
|
879
885
|
end
|
@@ -882,12 +888,14 @@ ID Since Last tweeted at Tweets Favorites Listed Following...
|
|
882
888
|
describe "#favorite" do
|
883
889
|
before do
|
884
890
|
@cli.options = @cli.options.merge("profile" => fixture_path + "/.trc")
|
885
|
-
stub_post("/1/favorites/create
|
891
|
+
stub_post("/1.1/favorites/create.json").
|
892
|
+
with(:body => {:id => "26755176471724032"}).
|
886
893
|
to_return(:body => fixture("status.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
887
894
|
end
|
888
895
|
it "should request the correct resource" do
|
889
896
|
@cli.favorite("26755176471724032")
|
890
|
-
a_post("/1/favorites/create
|
897
|
+
a_post("/1.1/favorites/create.json").
|
898
|
+
with(:body => {:id => "26755176471724032"}).
|
891
899
|
should have_been_made
|
892
900
|
end
|
893
901
|
it "should have the correct output" do
|
@@ -898,86 +906,93 @@ ID Since Last tweeted at Tweets Favorites Listed Following...
|
|
898
906
|
|
899
907
|
describe "#favorites" do
|
900
908
|
before do
|
901
|
-
stub_get("/1/favorites.json").
|
909
|
+
stub_get("/1.1/favorites/list.json").
|
902
910
|
with(:query => {:count => "20"}).
|
903
911
|
to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
904
912
|
end
|
905
913
|
it "should request the correct resource" do
|
906
914
|
@cli.favorites
|
907
|
-
a_get("/1/favorites.json").
|
915
|
+
a_get("/1.1/favorites/list.json").
|
908
916
|
with(:query => {:count => "20"}).
|
909
917
|
should have_been_made
|
910
918
|
end
|
911
919
|
it "should have the correct output" do
|
912
920
|
@cli.favorites
|
913
921
|
$stdout.string.should == <<-eos
|
914
|
-
\e[1m\e[33m @
|
915
|
-
|
916
|
-
CI, the element Oxygen.
|
922
|
+
\e[1m\e[33m @mutgoff\e[0m
|
923
|
+
Happy Birthday @imdane. Watch out for those @rally pranksters!
|
917
924
|
|
918
|
-
\e[1m\e[33m @
|
919
|
-
|
920
|
-
|
925
|
+
\e[1m\e[33m @ironicsans\e[0m
|
926
|
+
If you like good real-life stories, check out @NarrativelyNY's just-launched
|
927
|
+
site http://t.co/wiUL07jE (and also visit http://t.co/ZoyQxqWA)
|
921
928
|
|
922
|
-
\e[1m\e[33m @
|
923
|
-
|
924
|
-
|
929
|
+
\e[1m\e[33m @pat_shaughnessy\e[0m
|
930
|
+
Something else to vote for: "New Rails workshops to bring more women into the
|
931
|
+
Boston software scene" http://t.co/eNBuckHc /cc @bostonrb
|
925
932
|
|
926
|
-
\e[1m\e[33m @
|
927
|
-
|
928
|
-
mystery. Today is a gift. That's why it's called the present.
|
933
|
+
\e[1m\e[33m @calebelston\e[0m
|
934
|
+
Pushing the button to launch the site. http://t.co/qLoEn5jG
|
929
935
|
|
930
|
-
\e[1m\e[33m @
|
931
|
-
@
|
936
|
+
\e[1m\e[33m @calebelston\e[0m
|
937
|
+
RT @olivercameron: Mosaic looks cool: http://t.co/A8013C9k
|
932
938
|
|
933
|
-
\e[1m\e[33m @
|
934
|
-
|
939
|
+
\e[1m\e[33m @fivethirtyeight\e[0m
|
940
|
+
The Weatherman is Not a Moron: http://t.co/ZwL5Gnq5. An excerpt from my book,
|
941
|
+
THE SIGNAL AND THE NOISE (http://t.co/fNXj8vCE)
|
935
942
|
|
936
|
-
\e[1m\e[33m @
|
937
|
-
|
943
|
+
\e[1m\e[33m @codeforamerica\e[0m
|
944
|
+
RT @randomhacks: Going to Code Across Austin II: Y'all Come Hack Now, Sat,
|
945
|
+
Sep 8 http://t.co/Sk5BM7U3 We'll see y'all there! #rhok @codeforamerica
|
946
|
+
@TheaClay
|
938
947
|
|
939
|
-
\e[1m\e[33m @
|
940
|
-
|
948
|
+
\e[1m\e[33m @fbjork\e[0m
|
949
|
+
RT @jondot: Just published: "Pragmatic Concurrency With #Ruby"
|
950
|
+
http://t.co/kGEykswZ /cc @JRuby @headius
|
941
951
|
|
942
|
-
\e[1m\e[33m @
|
943
|
-
|
952
|
+
\e[1m\e[33m @mbostock\e[0m
|
953
|
+
If you are wondering how we computed the split bubbles: http://t.co/BcaqSs5u
|
944
954
|
|
945
|
-
\e[1m\e[33m @
|
946
|
-
|
947
|
-
a clever German. http://t.co/JvLNQCDm @skilldrick @hoverbird
|
955
|
+
\e[1m\e[33m @FakeDorsey\e[0m
|
956
|
+
“Write drunk. Edit sober.”—Ernest Hemingway
|
948
957
|
|
949
|
-
\e[1m\e[33m @
|
950
|
-
|
958
|
+
\e[1m\e[33m @al3x\e[0m
|
959
|
+
RT @wcmaier: Better banking through better ops: build something new with us
|
960
|
+
@Simplify (remote, PDX) http://t.co/8WgzKZH3
|
951
961
|
|
952
|
-
\e[1m\e[33m @
|
953
|
-
|
962
|
+
\e[1m\e[33m @calebelston\e[0m
|
963
|
+
We just announced Mosaic, what we've been working on since the Yobongo
|
964
|
+
acquisition. My personal post, http://t.co/ELOyIRZU @heymosaic
|
954
965
|
|
955
|
-
\e[1m\e[33m @
|
956
|
-
|
966
|
+
\e[1m\e[33m @BarackObama\e[0m
|
967
|
+
Donate $10 or more --> get your favorite car magnet: http://t.co/NfRhl2s2
|
968
|
+
#Obama2012
|
957
969
|
|
958
|
-
\e[1m\e[33m @
|
959
|
-
|
970
|
+
\e[1m\e[33m @JEG2\e[0m
|
971
|
+
RT @tenderlove: If corporations are people, can we use them to drive in the
|
972
|
+
carpool lane?
|
960
973
|
|
961
|
-
\e[1m\e[33m @
|
962
|
-
|
974
|
+
\e[1m\e[33m @eveningedition\e[0m
|
975
|
+
LDN—Obama's nomination; Putin woos APEC; Bombs hit Damascus; Quakes shake
|
976
|
+
China; Canada cuts Iran ties; weekend read: http://t.co/OFs6dVW4
|
963
977
|
|
964
|
-
\e[1m\e[33m @
|
965
|
-
|
966
|
-
|
978
|
+
\e[1m\e[33m @dhh\e[0m
|
979
|
+
RT @ggreenwald: Democrats parade Osama bin Laden's corpse as their proudest
|
980
|
+
achievement: why this goulish jingoism is so warped http://t.co/kood278s
|
967
981
|
|
968
|
-
\e[1m\e[33m @
|
969
|
-
|
970
|
-
|
982
|
+
\e[1m\e[33m @jasonfried\e[0m
|
983
|
+
The story of Mars Curiosity's gears, made by a factory in Rockford, IL:
|
984
|
+
http://t.co/MwCRsHQg
|
971
985
|
|
972
|
-
\e[1m\e[33m @
|
973
|
-
@
|
986
|
+
\e[1m\e[33m @sferik\e[0m
|
987
|
+
@episod @twitterapi now https://t.co/I17jUTu2 and https://t.co/deDu4Hgw seem
|
988
|
+
to be missing "1.1" from the URL.
|
974
989
|
|
975
|
-
\e[1m\e[33m @
|
976
|
-
@
|
990
|
+
\e[1m\e[33m @sferik\e[0m
|
991
|
+
@episod @twitterapi Did you catch https://t.co/VHsQvZT0 as well?
|
977
992
|
|
978
|
-
\e[1m\e[33m @
|
979
|
-
|
980
|
-
|
993
|
+
\e[1m\e[33m @dwiskus\e[0m
|
994
|
+
Gentlemen, you can't fight in here! This is the war room!
|
995
|
+
http://t.co/kMxMYyqF
|
981
996
|
|
982
997
|
eos
|
983
998
|
end
|
@@ -989,26 +1004,26 @@ ID Since Last tweeted at Tweets Favorites Listed Following...
|
|
989
1004
|
@cli.favorites
|
990
1005
|
$stdout.string.should == <<-eos
|
991
1006
|
ID,Posted at,Screen name,Text
|
992
|
-
|
993
|
-
|
994
|
-
|
995
|
-
|
996
|
-
|
997
|
-
|
998
|
-
|
999
|
-
|
1000
|
-
|
1001
|
-
|
1002
|
-
|
1003
|
-
|
1004
|
-
|
1005
|
-
|
1006
|
-
|
1007
|
-
|
1008
|
-
|
1009
|
-
|
1010
|
-
|
1011
|
-
|
1007
|
+
244111636544225280,2012-09-07 16:35:24 +0000,mutgoff,Happy Birthday @imdane. Watch out for those @rally pranksters!
|
1008
|
+
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)"
|
1009
|
+
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"
|
1010
|
+
244109797308379136,2012-09-07 16:28:05 +0000,calebelston,Pushing the button to launch the site. http://t.co/qLoEn5jG
|
1011
|
+
244108728834592770,2012-09-07 16:23:50 +0000,calebelston,RT @olivercameron: Mosaic looks cool: http://t.co/A8013C9k
|
1012
|
+
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)"
|
1013
|
+
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"
|
1014
|
+
244107236262170624,2012-09-07 16:17:55 +0000,fbjork,"RT @jondot: Just published: ""Pragmatic Concurrency With #Ruby"" http://t.co/kGEykswZ /cc @JRuby @headius"
|
1015
|
+
244106476048764928,2012-09-07 16:14:53 +0000,mbostock,If you are wondering how we computed the split bubbles: http://t.co/BcaqSs5u
|
1016
|
+
244105599351148544,2012-09-07 16:11:24 +0000,FakeDorsey,“Write drunk. Edit sober.”—Ernest Hemingway
|
1017
|
+
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"
|
1018
|
+
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"
|
1019
|
+
244103057175113729,2012-09-07 16:01:18 +0000,BarackObama,Donate $10 or more --> get your favorite car magnet: http://t.co/NfRhl2s2 #Obama2012
|
1020
|
+
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?"
|
1021
|
+
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
|
1022
|
+
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
|
1023
|
+
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"
|
1024
|
+
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."
|
1025
|
+
244100411563339777,2012-09-07 15:50:47 +0000,sferik,@episod @twitterapi Did you catch https://t.co/VHsQvZT0 as well?
|
1026
|
+
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"
|
1012
1027
|
eos
|
1013
1028
|
end
|
1014
1029
|
end
|
@@ -1019,27 +1034,27 @@ ID,Posted at,Screen name,Text
|
|
1019
1034
|
it "should output in long format" do
|
1020
1035
|
@cli.favorites
|
1021
1036
|
$stdout.string.should == <<-eos
|
1022
|
-
ID Posted at Screen name
|
1023
|
-
|
1024
|
-
|
1025
|
-
|
1026
|
-
|
1027
|
-
|
1028
|
-
|
1029
|
-
|
1030
|
-
|
1031
|
-
|
1032
|
-
|
1033
|
-
|
1034
|
-
|
1035
|
-
|
1036
|
-
|
1037
|
-
|
1038
|
-
|
1039
|
-
|
1040
|
-
|
1041
|
-
|
1042
|
-
|
1037
|
+
ID Posted at Screen name Text
|
1038
|
+
244111636544225280 Sep 7 08:35 @mutgoff Happy Birthday @imdane. W...
|
1039
|
+
244111183165157376 Sep 7 08:33 @ironicsans If you like good real-lif...
|
1040
|
+
244110336414859264 Sep 7 08:30 @pat_shaughnessy Something else to vote fo...
|
1041
|
+
244109797308379136 Sep 7 08:28 @calebelston Pushing the button to lau...
|
1042
|
+
244108728834592770 Sep 7 08:23 @calebelston RT @olivercameron: Mosaic...
|
1043
|
+
244107890632294400 Sep 7 08:20 @fivethirtyeight The Weatherman is Not a M...
|
1044
|
+
244107823733174272 Sep 7 08:20 @codeforamerica RT @randomhacks: Going to...
|
1045
|
+
244107236262170624 Sep 7 08:17 @fbjork RT @jondot: Just publishe...
|
1046
|
+
244106476048764928 Sep 7 08:14 @mbostock If you are wondering how ...
|
1047
|
+
244105599351148544 Sep 7 08:11 @FakeDorsey “Write drunk. Edit sober....
|
1048
|
+
244104558433951744 Sep 7 08:07 @al3x RT @wcmaier: Better banki...
|
1049
|
+
244104146997870594 Sep 7 08:05 @calebelston We just announced Mosaic,...
|
1050
|
+
244103057175113729 Sep 7 08:01 @BarackObama Donate $10 or more --> ge...
|
1051
|
+
244102834398851073 Sep 7 08:00 @JEG2 RT @tenderlove: If corpor...
|
1052
|
+
244102741125890048 Sep 7 08:00 @eveningedition LDN—Obama's nomination; P...
|
1053
|
+
244102729860009984 Sep 7 08:00 @dhh RT @ggreenwald: Democrats...
|
1054
|
+
244102490646278146 Sep 7 07:59 @jasonfried The story of Mars Curiosi...
|
1055
|
+
244102209942458368 Sep 7 07:57 @sferik @episod @twitterapi now h...
|
1056
|
+
244100411563339777 Sep 7 07:50 @sferik @episod @twitterapi Did y...
|
1057
|
+
244099460672679938 Sep 7 07:47 @dwiskus Gentlemen, you can't figh...
|
1043
1058
|
eos
|
1044
1059
|
end
|
1045
1060
|
context "--reverse" do
|
@@ -1049,94 +1064,94 @@ ID Posted at Screen name Text
|
|
1049
1064
|
it "should reverse the order of the sort" do
|
1050
1065
|
@cli.favorites
|
1051
1066
|
$stdout.string.should == <<-eos
|
1052
|
-
ID Posted at Screen name
|
1053
|
-
|
1054
|
-
|
1055
|
-
|
1056
|
-
|
1057
|
-
|
1058
|
-
|
1059
|
-
|
1060
|
-
|
1061
|
-
|
1062
|
-
|
1063
|
-
|
1064
|
-
|
1065
|
-
|
1066
|
-
|
1067
|
-
|
1068
|
-
|
1069
|
-
|
1070
|
-
|
1071
|
-
|
1072
|
-
|
1067
|
+
ID Posted at Screen name Text
|
1068
|
+
244099460672679938 Sep 7 07:47 @dwiskus Gentlemen, you can't figh...
|
1069
|
+
244100411563339777 Sep 7 07:50 @sferik @episod @twitterapi Did y...
|
1070
|
+
244102209942458368 Sep 7 07:57 @sferik @episod @twitterapi now h...
|
1071
|
+
244102490646278146 Sep 7 07:59 @jasonfried The story of Mars Curiosi...
|
1072
|
+
244102729860009984 Sep 7 08:00 @dhh RT @ggreenwald: Democrats...
|
1073
|
+
244102741125890048 Sep 7 08:00 @eveningedition LDN—Obama's nomination; P...
|
1074
|
+
244102834398851073 Sep 7 08:00 @JEG2 RT @tenderlove: If corpor...
|
1075
|
+
244103057175113729 Sep 7 08:01 @BarackObama Donate $10 or more --> ge...
|
1076
|
+
244104146997870594 Sep 7 08:05 @calebelston We just announced Mosaic,...
|
1077
|
+
244104558433951744 Sep 7 08:07 @al3x RT @wcmaier: Better banki...
|
1078
|
+
244105599351148544 Sep 7 08:11 @FakeDorsey “Write drunk. Edit sober....
|
1079
|
+
244106476048764928 Sep 7 08:14 @mbostock If you are wondering how ...
|
1080
|
+
244107236262170624 Sep 7 08:17 @fbjork RT @jondot: Just publishe...
|
1081
|
+
244107823733174272 Sep 7 08:20 @codeforamerica RT @randomhacks: Going to...
|
1082
|
+
244107890632294400 Sep 7 08:20 @fivethirtyeight The Weatherman is Not a M...
|
1083
|
+
244108728834592770 Sep 7 08:23 @calebelston RT @olivercameron: Mosaic...
|
1084
|
+
244109797308379136 Sep 7 08:28 @calebelston Pushing the button to lau...
|
1085
|
+
244110336414859264 Sep 7 08:30 @pat_shaughnessy Something else to vote fo...
|
1086
|
+
244111183165157376 Sep 7 08:33 @ironicsans If you like good real-lif...
|
1087
|
+
244111636544225280 Sep 7 08:35 @mutgoff Happy Birthday @imdane. W...
|
1073
1088
|
eos
|
1074
1089
|
end
|
1075
1090
|
end
|
1076
1091
|
end
|
1077
1092
|
context "--number" do
|
1078
1093
|
before do
|
1079
|
-
stub_get("/1/favorites.json").
|
1094
|
+
stub_get("/1.1/favorites/list.json").
|
1080
1095
|
with(:query => {:count => "1"}).
|
1081
1096
|
to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
1082
|
-
stub_get("/1/favorites.json").
|
1097
|
+
stub_get("/1.1/favorites/list.json").
|
1083
1098
|
with(:query => {:count => "200"}).
|
1084
1099
|
to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
1085
|
-
stub_get("/1/favorites.json").
|
1086
|
-
with(:query => {:count => "200", :max_id => "
|
1100
|
+
stub_get("/1.1/favorites/list.json").
|
1101
|
+
with(:query => {:count => "200", :max_id => "244099460672679937"}).
|
1087
1102
|
to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
1088
1103
|
(5..185).step(20).to_a.reverse.each do |count|
|
1089
|
-
stub_get("/1/favorites.json").
|
1090
|
-
with(:query => {:count => count, :max_id => "
|
1104
|
+
stub_get("/1.1/favorites/list.json").
|
1105
|
+
with(:query => {:count => count, :max_id => "244099460672679937"}).
|
1091
1106
|
to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
1092
1107
|
end
|
1093
1108
|
end
|
1094
1109
|
it "should limit the number of results to 1" do
|
1095
1110
|
@cli.options = @cli.options.merge("number" => 1)
|
1096
1111
|
@cli.favorites
|
1097
|
-
a_get("/1/favorites.json").
|
1112
|
+
a_get("/1.1/favorites/list.json").
|
1098
1113
|
with(:query => {:count => "1"}).
|
1099
1114
|
should have_been_made
|
1100
1115
|
end
|
1101
1116
|
it "should limit the number of results to 345" do
|
1102
1117
|
@cli.options = @cli.options.merge("number" => 345)
|
1103
1118
|
@cli.favorites
|
1104
|
-
a_get("/1/favorites.json").
|
1119
|
+
a_get("/1.1/favorites/list.json").
|
1105
1120
|
with(:query => {:count => "200"}).
|
1106
1121
|
should have_been_made
|
1107
|
-
a_get("/1/favorites.json").
|
1108
|
-
with(:query => {:count => "200", :max_id => "
|
1122
|
+
a_get("/1.1/favorites/list.json").
|
1123
|
+
with(:query => {:count => "200", :max_id => "244099460672679937"}).
|
1109
1124
|
should have_been_made.times(7)
|
1110
1125
|
(5..185).step(20).to_a.reverse.each do |count|
|
1111
|
-
a_get("/1/favorites.json").
|
1112
|
-
with(:query => {:count => count, :max_id => "
|
1126
|
+
a_get("/1.1/favorites/list.json").
|
1127
|
+
with(:query => {:count => count, :max_id => "244099460672679937"}).
|
1113
1128
|
should have_been_made
|
1114
1129
|
end
|
1115
1130
|
end
|
1116
1131
|
end
|
1117
1132
|
context "with a user passed" do
|
1118
1133
|
before do
|
1119
|
-
stub_get("/1/favorites/
|
1120
|
-
with(:query => {:count => "20"}).
|
1134
|
+
stub_get("/1.1/favorites/list.json").
|
1135
|
+
with(:query => {:count => "20", :screen_name => "sferik"}).
|
1121
1136
|
to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
1122
1137
|
end
|
1123
1138
|
it "should request the correct resource" do
|
1124
1139
|
@cli.favorites("sferik")
|
1125
|
-
a_get("/1/favorites/
|
1126
|
-
with(:query => {:count => "20"}).
|
1140
|
+
a_get("/1.1/favorites/list.json").
|
1141
|
+
with(:query => {:count => "20", :screen_name => "sferik"}).
|
1127
1142
|
should have_been_made
|
1128
1143
|
end
|
1129
1144
|
context "--id" do
|
1130
1145
|
before do
|
1131
1146
|
@cli.options = @cli.options.merge("id" => true)
|
1132
|
-
stub_get("/1/favorites/
|
1133
|
-
with(:query => {:count => "20"}).
|
1147
|
+
stub_get("/1.1/favorites/list.json").
|
1148
|
+
with(:query => {:user_id => "7505382", :count => "20"}).
|
1134
1149
|
to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
1135
1150
|
end
|
1136
1151
|
it "should request the correct resource" do
|
1137
1152
|
@cli.favorites("7505382")
|
1138
|
-
a_get("/1/favorites/
|
1139
|
-
with(:query => {:count => "20"}).
|
1153
|
+
a_get("/1.1/favorites/list.json").
|
1154
|
+
with(:query => {:user_id => "7505382", :count => "20"}).
|
1140
1155
|
should have_been_made
|
1141
1156
|
end
|
1142
1157
|
end
|
@@ -1149,25 +1164,25 @@ ID Posted at Screen name Text
|
|
1149
1164
|
end
|
1150
1165
|
context "one user" do
|
1151
1166
|
before do
|
1152
|
-
stub_get("/1/friends/ids.json").
|
1167
|
+
stub_get("/1.1/friends/ids.json").
|
1153
1168
|
with(:query => {:cursor => "-1"}).
|
1154
1169
|
to_return(:body => fixture("friends_ids.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
1155
|
-
|
1156
|
-
with(:
|
1170
|
+
stub_post("/1.1/users/lookup.json").
|
1171
|
+
with(:body => {:screen_name => "sferik,pengwynn"}).
|
1157
1172
|
to_return(:body => fixture("users.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
1158
|
-
stub_post("/1/friendships/create.json").
|
1173
|
+
stub_post("/1.1/friendships/create.json").
|
1159
1174
|
with(:body => {:user_id => "14100886"}).
|
1160
1175
|
to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
1161
1176
|
end
|
1162
1177
|
it "should request the correct resource" do
|
1163
1178
|
@cli.follow("sferik", "pengwynn")
|
1164
|
-
a_get("/1/friends/ids.json").
|
1179
|
+
a_get("/1.1/friends/ids.json").
|
1165
1180
|
with(:query => {:cursor => "-1"}).
|
1166
1181
|
should have_been_made
|
1167
|
-
|
1168
|
-
with(:
|
1182
|
+
a_post("/1.1/users/lookup.json").
|
1183
|
+
with(:body => {:screen_name => "sferik,pengwynn"}).
|
1169
1184
|
should have_been_made
|
1170
|
-
a_post("/1/friendships/create.json").
|
1185
|
+
a_post("/1.1/friendships/create.json").
|
1171
1186
|
with(:body => {:user_id => "14100886"}).
|
1172
1187
|
should have_been_made
|
1173
1188
|
end
|
@@ -1178,50 +1193,50 @@ ID Posted at Screen name Text
|
|
1178
1193
|
context "--id" do
|
1179
1194
|
before do
|
1180
1195
|
@cli.options = @cli.options.merge("id" => true)
|
1181
|
-
stub_get("/1/friends/ids.json").
|
1196
|
+
stub_get("/1.1/friends/ids.json").
|
1182
1197
|
with(:query => {:cursor => "-1"}).
|
1183
1198
|
to_return(:body => fixture("friends_ids.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
1184
|
-
|
1185
|
-
with(:
|
1199
|
+
stub_post("/1.1/users/lookup.json").
|
1200
|
+
with(:body => {:user_id => "7505382,14100886"}).
|
1186
1201
|
to_return(:body => fixture("users.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
1187
|
-
stub_post("/1/friendships/create.json").
|
1202
|
+
stub_post("/1.1/friendships/create.json").
|
1188
1203
|
with(:body => {:user_id => "14100886"}).
|
1189
1204
|
to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
1190
1205
|
end
|
1191
1206
|
it "should request the correct resource" do
|
1192
1207
|
@cli.follow("7505382", "14100886")
|
1193
|
-
a_get("/1/friends/ids.json").
|
1208
|
+
a_get("/1.1/friends/ids.json").
|
1194
1209
|
with(:query => {:cursor => "-1"}).
|
1195
1210
|
should have_been_made
|
1196
|
-
|
1197
|
-
with(:
|
1211
|
+
a_post("/1.1/users/lookup.json").
|
1212
|
+
with(:body => {:user_id => "7505382,14100886"}).
|
1198
1213
|
should have_been_made
|
1199
|
-
a_post("/1/friendships/create.json").
|
1214
|
+
a_post("/1.1/friendships/create.json").
|
1200
1215
|
with(:body => {:user_id => "14100886"}).
|
1201
1216
|
should have_been_made
|
1202
1217
|
end
|
1203
1218
|
end
|
1204
1219
|
context "Twitter is down" do
|
1205
1220
|
it "should retry 3 times and then raise an error" do
|
1206
|
-
stub_get("/1/friends/ids.json").
|
1221
|
+
stub_get("/1.1/friends/ids.json").
|
1207
1222
|
with(:query => {:cursor => "-1"}).
|
1208
1223
|
to_return(:body => fixture("friends_ids.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
1209
|
-
|
1210
|
-
with(:
|
1224
|
+
stub_post("/1.1/users/lookup.json").
|
1225
|
+
with(:body => {:screen_name => "sferik,pengwynn"}).
|
1211
1226
|
to_return(:body => fixture("users.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
1212
|
-
stub_post("/1/friendships/create.json").
|
1227
|
+
stub_post("/1.1/friendships/create.json").
|
1213
1228
|
with(:body => {:user_id => "14100886"}).
|
1214
1229
|
to_return(:status => 502)
|
1215
1230
|
lambda do
|
1216
1231
|
@cli.follow("sferik", "pengwynn")
|
1217
1232
|
end.should raise_error("Twitter is down or being upgraded.")
|
1218
|
-
a_get("/1/friends/ids.json").
|
1233
|
+
a_get("/1.1/friends/ids.json").
|
1219
1234
|
with(:query => {:cursor => "-1"}).
|
1220
1235
|
should have_been_made.times(3)
|
1221
|
-
|
1222
|
-
with(:
|
1236
|
+
a_post("/1.1/users/lookup.json").
|
1237
|
+
with(:body => {:screen_name => "sferik,pengwynn"}).
|
1223
1238
|
should have_been_made.times(3)
|
1224
|
-
a_post("/1/friendships/create.json").
|
1239
|
+
a_post("/1.1/friendships/create.json").
|
1225
1240
|
with(:body => {:user_id => "14100886"}).
|
1226
1241
|
should have_been_made.times(3)
|
1227
1242
|
end
|
@@ -1231,20 +1246,20 @@ ID Posted at Screen name Text
|
|
1231
1246
|
|
1232
1247
|
describe "#followings" do
|
1233
1248
|
before do
|
1234
|
-
stub_get("/1/friends/ids.json").
|
1249
|
+
stub_get("/1.1/friends/ids.json").
|
1235
1250
|
with(:query => {:cursor => "-1"}).
|
1236
1251
|
to_return(:body => fixture("friends_ids.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
1237
|
-
|
1238
|
-
with(:
|
1252
|
+
stub_post("/1.1/users/lookup.json").
|
1253
|
+
with(:body => {:user_id => "7505382"}).
|
1239
1254
|
to_return(:body => fixture("users.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
1240
1255
|
end
|
1241
1256
|
it "should request the correct resource" do
|
1242
1257
|
@cli.followings
|
1243
|
-
a_get("/1/friends/ids.json").
|
1258
|
+
a_get("/1.1/friends/ids.json").
|
1244
1259
|
with(:query => {:cursor => "-1"}).
|
1245
1260
|
should have_been_made
|
1246
|
-
|
1247
|
-
with(:
|
1261
|
+
a_post("/1.1/users/lookup.json").
|
1262
|
+
with(:body => {:user_id => "7505382"}).
|
1248
1263
|
should have_been_made
|
1249
1264
|
end
|
1250
1265
|
it "should have the correct output" do
|
@@ -1360,34 +1375,34 @@ ID Since Last tweeted at Tweets Favorites Listed Following...
|
|
1360
1375
|
end
|
1361
1376
|
context "with a user passed" do
|
1362
1377
|
before do
|
1363
|
-
stub_get("/1/friends/ids.json").
|
1378
|
+
stub_get("/1.1/friends/ids.json").
|
1364
1379
|
with(:query => {:cursor => "-1", :screen_name => "sferik"}).
|
1365
1380
|
to_return(:body => fixture("friends_ids.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
1366
1381
|
end
|
1367
1382
|
it "should request the correct resource" do
|
1368
1383
|
@cli.followings("sferik")
|
1369
|
-
a_get("/1/friends/ids.json").
|
1384
|
+
a_get("/1.1/friends/ids.json").
|
1370
1385
|
with(:query => {:cursor => "-1", :screen_name => "sferik"}).
|
1371
1386
|
should have_been_made
|
1372
|
-
|
1373
|
-
with(:
|
1387
|
+
a_post("/1.1/users/lookup.json").
|
1388
|
+
with(:body => {:user_id => "7505382"}).
|
1374
1389
|
should have_been_made
|
1375
1390
|
end
|
1376
1391
|
end
|
1377
1392
|
context "--id" do
|
1378
1393
|
before do
|
1379
1394
|
@cli.options = @cli.options.merge("id" => true)
|
1380
|
-
stub_get("/1/friends/ids.json").
|
1395
|
+
stub_get("/1.1/friends/ids.json").
|
1381
1396
|
with(:query => {:cursor => "-1", :user_id => "7505382"}).
|
1382
1397
|
to_return(:body => fixture("friends_ids.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
1383
1398
|
end
|
1384
1399
|
it "should request the correct resource" do
|
1385
1400
|
@cli.followings("7505382")
|
1386
|
-
a_get("/1/friends/ids.json").
|
1401
|
+
a_get("/1.1/friends/ids.json").
|
1387
1402
|
with(:query => {:cursor => "-1", :user_id => "7505382"}).
|
1388
1403
|
should have_been_made
|
1389
|
-
|
1390
|
-
with(:
|
1404
|
+
a_post("/1.1/users/lookup.json").
|
1405
|
+
with(:body => {:user_id => "7505382"}).
|
1391
1406
|
should have_been_made
|
1392
1407
|
end
|
1393
1408
|
end
|
@@ -1395,20 +1410,20 @@ ID Since Last tweeted at Tweets Favorites Listed Following...
|
|
1395
1410
|
|
1396
1411
|
describe "#followers" do
|
1397
1412
|
before do
|
1398
|
-
stub_get("/1/followers/ids.json").
|
1413
|
+
stub_get("/1.1/followers/ids.json").
|
1399
1414
|
with(:query => {:cursor => "-1"}).
|
1400
1415
|
to_return(:body => fixture("friends_ids.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
1401
|
-
|
1402
|
-
with(:
|
1416
|
+
stub_post("/1.1/users/lookup.json").
|
1417
|
+
with(:body => {:user_id => "7505382"}).
|
1403
1418
|
to_return(:body => fixture("users.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
1404
1419
|
end
|
1405
1420
|
it "should request the correct resource" do
|
1406
1421
|
@cli.followers
|
1407
|
-
a_get("/1/followers/ids.json").
|
1422
|
+
a_get("/1.1/followers/ids.json").
|
1408
1423
|
with(:query => {:cursor => "-1"}).
|
1409
1424
|
should have_been_made
|
1410
|
-
|
1411
|
-
with(:
|
1425
|
+
a_post("/1.1/users/lookup.json").
|
1426
|
+
with(:body => {:user_id => "7505382"}).
|
1412
1427
|
should have_been_made
|
1413
1428
|
end
|
1414
1429
|
it "should have the correct output" do
|
@@ -1524,36 +1539,36 @@ ID Since Last tweeted at Tweets Favorites Listed Following...
|
|
1524
1539
|
end
|
1525
1540
|
context "with a user passed" do
|
1526
1541
|
before do
|
1527
|
-
stub_get("/1/followers/ids.json").
|
1542
|
+
stub_get("/1.1/followers/ids.json").
|
1528
1543
|
with(:query => {:cursor => "-1", :screen_name => "sferik"}).
|
1529
1544
|
to_return(:body => fixture("friends_ids.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
1530
|
-
|
1531
|
-
with(:
|
1545
|
+
stub_post("/1.1/users/lookup.json").
|
1546
|
+
with(:body => {:user_id => "213747670,428004849"}).
|
1532
1547
|
to_return(:body => fixture("users.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
1533
1548
|
end
|
1534
1549
|
it "should request the correct resource" do
|
1535
1550
|
@cli.followers("sferik")
|
1536
|
-
a_get("/1/followers/ids.json").
|
1551
|
+
a_get("/1.1/followers/ids.json").
|
1537
1552
|
with(:query => {:cursor => "-1", :screen_name => "sferik"}).
|
1538
1553
|
should have_been_made
|
1539
|
-
|
1540
|
-
with(:
|
1554
|
+
a_post("/1.1/users/lookup.json").
|
1555
|
+
with(:body => {:user_id => "7505382"}).
|
1541
1556
|
should have_been_made
|
1542
1557
|
end
|
1543
1558
|
context "--id" do
|
1544
1559
|
before do
|
1545
1560
|
@cli.options = @cli.options.merge("id" => true)
|
1546
|
-
stub_get("/1/followers/ids.json").
|
1561
|
+
stub_get("/1.1/followers/ids.json").
|
1547
1562
|
with(:query => {:cursor => "-1", :user_id => "7505382"}).
|
1548
1563
|
to_return(:body => fixture("friends_ids.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
1549
1564
|
end
|
1550
1565
|
it "should request the correct resource" do
|
1551
1566
|
@cli.followers("7505382")
|
1552
|
-
a_get("/1/followers/ids.json").
|
1567
|
+
a_get("/1.1/followers/ids.json").
|
1553
1568
|
with(:query => {:cursor => "-1", :user_id => "7505382"}).
|
1554
1569
|
should have_been_made
|
1555
|
-
|
1556
|
-
with(:
|
1570
|
+
a_post("/1.1/users/lookup.json").
|
1571
|
+
with(:body => {:user_id => "7505382"}).
|
1557
1572
|
should have_been_made
|
1558
1573
|
end
|
1559
1574
|
end
|
@@ -1562,26 +1577,26 @@ ID Since Last tweeted at Tweets Favorites Listed Following...
|
|
1562
1577
|
|
1563
1578
|
describe "#friends" do
|
1564
1579
|
before do
|
1565
|
-
stub_get("/1/friends/ids.json").
|
1580
|
+
stub_get("/1.1/friends/ids.json").
|
1566
1581
|
with(:query => {:cursor => "-1"}).
|
1567
1582
|
to_return(:body => fixture("friends_ids.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
1568
|
-
stub_get("/1/followers/ids.json").
|
1583
|
+
stub_get("/1.1/followers/ids.json").
|
1569
1584
|
with(:query => {:cursor => "-1"}).
|
1570
1585
|
to_return(:body => fixture("friends_ids.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
1571
|
-
|
1572
|
-
with(:
|
1586
|
+
stub_post("/1.1/users/lookup.json").
|
1587
|
+
with(:body => {:user_id => "7505382"}).
|
1573
1588
|
to_return(:body => fixture("users.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
1574
1589
|
end
|
1575
1590
|
it "should request the correct resource" do
|
1576
1591
|
@cli.friends
|
1577
|
-
a_get("/1/friends/ids.json").
|
1592
|
+
a_get("/1.1/friends/ids.json").
|
1578
1593
|
with(:query => {:cursor => "-1"}).
|
1579
1594
|
should have_been_made
|
1580
|
-
a_get("/1/followers/ids.json").
|
1595
|
+
a_get("/1.1/followers/ids.json").
|
1581
1596
|
with(:query => {:cursor => "-1"}).
|
1582
1597
|
should have_been_made
|
1583
|
-
|
1584
|
-
with(:
|
1598
|
+
a_post("/1.1/users/lookup.json").
|
1599
|
+
with(:body => {:user_id => "7505382"}).
|
1585
1600
|
should have_been_made
|
1586
1601
|
end
|
1587
1602
|
it "should have the correct output" do
|
@@ -1697,45 +1712,45 @@ ID Since Last tweeted at Tweets Favorites Listed Following...
|
|
1697
1712
|
end
|
1698
1713
|
context "with a user passed" do
|
1699
1714
|
before do
|
1700
|
-
stub_get("/1/friends/ids.json").
|
1715
|
+
stub_get("/1.1/friends/ids.json").
|
1701
1716
|
with(:query => {:cursor => "-1", :screen_name => "sferik"}).
|
1702
1717
|
to_return(:body => fixture("friends_ids.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
1703
|
-
stub_get("/1/followers/ids.json").
|
1718
|
+
stub_get("/1.1/followers/ids.json").
|
1704
1719
|
with(:query => {:cursor => "-1", :screen_name => "sferik"}).
|
1705
1720
|
to_return(:body => fixture("friends_ids.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
1706
1721
|
end
|
1707
1722
|
it "should request the correct resource" do
|
1708
1723
|
@cli.friends("sferik")
|
1709
|
-
a_get("/1/friends/ids.json").
|
1724
|
+
a_get("/1.1/friends/ids.json").
|
1710
1725
|
with(:query => {:cursor => "-1", :screen_name => "sferik"}).
|
1711
1726
|
should have_been_made
|
1712
|
-
a_get("/1/followers/ids.json").
|
1727
|
+
a_get("/1.1/followers/ids.json").
|
1713
1728
|
with(:query => {:cursor => "-1", :screen_name => "sferik"}).
|
1714
1729
|
should have_been_made
|
1715
|
-
|
1716
|
-
with(:
|
1730
|
+
a_post("/1.1/users/lookup.json").
|
1731
|
+
with(:body => {:user_id => "7505382"}).
|
1717
1732
|
should have_been_made
|
1718
1733
|
end
|
1719
1734
|
context "--id" do
|
1720
1735
|
before do
|
1721
1736
|
@cli.options = @cli.options.merge("id" => true)
|
1722
|
-
stub_get("/1/friends/ids.json").
|
1737
|
+
stub_get("/1.1/friends/ids.json").
|
1723
1738
|
with(:query => {:cursor => "-1", :user_id => "7505382"}).
|
1724
1739
|
to_return(:body => fixture("friends_ids.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
1725
|
-
stub_get("/1/followers/ids.json").
|
1740
|
+
stub_get("/1.1/followers/ids.json").
|
1726
1741
|
with(:query => {:cursor => "-1", :user_id => "7505382"}).
|
1727
1742
|
to_return(:body => fixture("friends_ids.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
1728
1743
|
end
|
1729
1744
|
it "should request the correct resource" do
|
1730
1745
|
@cli.friends("7505382")
|
1731
|
-
a_get("/1/friends/ids.json").
|
1746
|
+
a_get("/1.1/friends/ids.json").
|
1732
1747
|
with(:query => {:cursor => "-1", :user_id => "7505382"}).
|
1733
1748
|
should have_been_made
|
1734
|
-
a_get("/1/followers/ids.json").
|
1749
|
+
a_get("/1.1/followers/ids.json").
|
1735
1750
|
with(:query => {:cursor => "-1", :user_id => "7505382"}).
|
1736
1751
|
should have_been_made
|
1737
|
-
|
1738
|
-
with(:
|
1752
|
+
a_post("/1.1/users/lookup.json").
|
1753
|
+
with(:body => {:user_id => "7505382"}).
|
1739
1754
|
should have_been_made
|
1740
1755
|
end
|
1741
1756
|
end
|
@@ -1744,26 +1759,26 @@ ID Since Last tweeted at Tweets Favorites Listed Following...
|
|
1744
1759
|
|
1745
1760
|
describe "#leaders" do
|
1746
1761
|
before do
|
1747
|
-
stub_get("/1/friends/ids.json").
|
1762
|
+
stub_get("/1.1/friends/ids.json").
|
1748
1763
|
with(:query => {:cursor => "-1"}).
|
1749
1764
|
to_return(:body => fixture("friends_ids.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
1750
|
-
stub_get("/1/followers/ids.json").
|
1765
|
+
stub_get("/1.1/followers/ids.json").
|
1751
1766
|
with(:query => {:cursor => "-1"}).
|
1752
1767
|
to_return(:body => fixture("followers_ids.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
1753
|
-
|
1754
|
-
with(:
|
1768
|
+
stub_post("/1.1/users/lookup.json").
|
1769
|
+
with(:body => {:user_id => "7505382"}).
|
1755
1770
|
to_return(:body => fixture("users.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
1756
1771
|
end
|
1757
1772
|
it "should request the correct resource" do
|
1758
1773
|
@cli.leaders
|
1759
|
-
a_get("/1/friends/ids.json").
|
1774
|
+
a_get("/1.1/friends/ids.json").
|
1760
1775
|
with(:query => {:cursor => "-1"}).
|
1761
1776
|
should have_been_made
|
1762
|
-
a_get("/1/followers/ids.json").
|
1777
|
+
a_get("/1.1/followers/ids.json").
|
1763
1778
|
with(:query => {:cursor => "-1"}).
|
1764
1779
|
should have_been_made
|
1765
|
-
|
1766
|
-
with(:
|
1780
|
+
a_post("/1.1/users/lookup.json").
|
1781
|
+
with(:body => {:user_id => "7505382"}).
|
1767
1782
|
should have_been_made
|
1768
1783
|
end
|
1769
1784
|
it "should have the correct output" do
|
@@ -1879,45 +1894,45 @@ ID Since Last tweeted at Tweets Favorites Listed Following...
|
|
1879
1894
|
end
|
1880
1895
|
context "with a user passed" do
|
1881
1896
|
before do
|
1882
|
-
stub_get("/1/friends/ids.json").
|
1897
|
+
stub_get("/1.1/friends/ids.json").
|
1883
1898
|
with(:query => {:cursor => "-1", :screen_name => "sferik"}).
|
1884
1899
|
to_return(:body => fixture("friends_ids.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
1885
|
-
stub_get("/1/followers/ids.json").
|
1900
|
+
stub_get("/1.1/followers/ids.json").
|
1886
1901
|
with(:query => {:cursor => "-1", :screen_name => "sferik"}).
|
1887
1902
|
to_return(:body => fixture("followers_ids.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
1888
1903
|
end
|
1889
1904
|
it "should request the correct resource" do
|
1890
1905
|
@cli.leaders("sferik")
|
1891
|
-
a_get("/1/friends/ids.json").
|
1906
|
+
a_get("/1.1/friends/ids.json").
|
1892
1907
|
with(:query => {:cursor => "-1", :screen_name => "sferik"}).
|
1893
1908
|
should have_been_made
|
1894
|
-
a_get("/1/followers/ids.json").
|
1909
|
+
a_get("/1.1/followers/ids.json").
|
1895
1910
|
with(:query => {:cursor => "-1", :screen_name => "sferik"}).
|
1896
1911
|
should have_been_made
|
1897
|
-
|
1898
|
-
with(:
|
1912
|
+
a_post("/1.1/users/lookup.json").
|
1913
|
+
with(:body => {:user_id => "7505382"}).
|
1899
1914
|
should have_been_made
|
1900
1915
|
end
|
1901
1916
|
context "--id" do
|
1902
1917
|
before do
|
1903
1918
|
@cli.options = @cli.options.merge("id" => true)
|
1904
|
-
stub_get("/1/friends/ids.json").
|
1919
|
+
stub_get("/1.1/friends/ids.json").
|
1905
1920
|
with(:query => {:cursor => "-1", :user_id => "7505382"}).
|
1906
1921
|
to_return(:body => fixture("friends_ids.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
1907
|
-
stub_get("/1/followers/ids.json").
|
1922
|
+
stub_get("/1.1/followers/ids.json").
|
1908
1923
|
with(:query => {:cursor => "-1", :user_id => "7505382"}).
|
1909
1924
|
to_return(:body => fixture("followers_ids.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
1910
1925
|
end
|
1911
1926
|
it "should request the correct resource" do
|
1912
1927
|
@cli.leaders("7505382")
|
1913
|
-
a_get("/1/friends/ids.json").
|
1928
|
+
a_get("/1.1/friends/ids.json").
|
1914
1929
|
with(:query => {:cursor => "-1", :user_id => "7505382"}).
|
1915
1930
|
should have_been_made
|
1916
|
-
a_get("/1/followers/ids.json").
|
1931
|
+
a_get("/1.1/followers/ids.json").
|
1917
1932
|
with(:query => {:cursor => "-1", :user_id => "7505382"}).
|
1918
1933
|
should have_been_made
|
1919
|
-
|
1920
|
-
with(:
|
1934
|
+
a_post("/1.1/users/lookup.json").
|
1935
|
+
with(:body => {:user_id => "7505382"}).
|
1921
1936
|
should have_been_made
|
1922
1937
|
end
|
1923
1938
|
end
|
@@ -1926,13 +1941,13 @@ ID Since Last tweeted at Tweets Favorites Listed Following...
|
|
1926
1941
|
|
1927
1942
|
describe "#lists" do
|
1928
1943
|
before do
|
1929
|
-
stub_get("/1/lists.json").
|
1944
|
+
stub_get("/1.1/lists/list.json").
|
1930
1945
|
with(:query => {:cursor => "-1"}).
|
1931
1946
|
to_return(:body => fixture("lists.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
1932
1947
|
end
|
1933
1948
|
it "should request the correct resource" do
|
1934
1949
|
@cli.lists
|
1935
|
-
a_get("/1/lists.json").
|
1950
|
+
a_get("/1.1/lists/list.json").
|
1936
1951
|
with(:query => {:cursor => "-1"}).
|
1937
1952
|
should have_been_made
|
1938
1953
|
end
|
@@ -2022,26 +2037,26 @@ ID Created at Screen name Slug Members Subscribers ...
|
|
2022
2037
|
end
|
2023
2038
|
context "with a user passed" do
|
2024
2039
|
before do
|
2025
|
-
stub_get("/1/lists.json").
|
2040
|
+
stub_get("/1.1/lists/list.json").
|
2026
2041
|
with(:query => {:cursor => "-1", :screen_name => "sferik"}).
|
2027
2042
|
to_return(:body => fixture("lists.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
2028
2043
|
end
|
2029
2044
|
it "should request the correct resource" do
|
2030
2045
|
@cli.lists("sferik")
|
2031
|
-
a_get("/1/lists.json").
|
2046
|
+
a_get("/1.1/lists/list.json").
|
2032
2047
|
with(:query => {:cursor => "-1", :screen_name => "sferik"}).
|
2033
2048
|
should have_been_made
|
2034
2049
|
end
|
2035
2050
|
context "--id" do
|
2036
2051
|
before do
|
2037
2052
|
@cli.options = @cli.options.merge("id" => true)
|
2038
|
-
stub_get("/1/lists.json").
|
2053
|
+
stub_get("/1.1/lists/list.json").
|
2039
2054
|
with(:query => {:cursor => "-1", :user_id => "7505382"}).
|
2040
2055
|
to_return(:body => fixture("lists.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
2041
2056
|
end
|
2042
2057
|
it "should request the correct resource" do
|
2043
2058
|
@cli.lists("7505382")
|
2044
|
-
a_get("/1/lists.json").
|
2059
|
+
a_get("/1.1/lists/list.json").
|
2045
2060
|
with(:query => {:cursor => "-1", :user_id => "7505382"}).
|
2046
2061
|
should have_been_made
|
2047
2062
|
end
|
@@ -2051,86 +2066,93 @@ ID Created at Screen name Slug Members Subscribers ...
|
|
2051
2066
|
|
2052
2067
|
describe "#mentions" do
|
2053
2068
|
before do
|
2054
|
-
stub_get("/1/statuses/
|
2069
|
+
stub_get("/1.1/statuses/mentions_timeline.json").
|
2055
2070
|
with(:query => {:count => "20"}).
|
2056
2071
|
to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
2057
2072
|
end
|
2058
2073
|
it "should request the correct resource" do
|
2059
2074
|
@cli.mentions
|
2060
|
-
a_get("/1/statuses/
|
2075
|
+
a_get("/1.1/statuses/mentions_timeline.json").
|
2061
2076
|
with(:query => {:count => "20"}).
|
2062
2077
|
should have_been_made
|
2063
2078
|
end
|
2064
2079
|
it "should have the correct output" do
|
2065
2080
|
@cli.mentions
|
2066
2081
|
$stdout.string.should == <<-eos
|
2067
|
-
\e[1m\e[33m @
|
2068
|
-
|
2069
|
-
CI, the element Oxygen.
|
2082
|
+
\e[1m\e[33m @mutgoff\e[0m
|
2083
|
+
Happy Birthday @imdane. Watch out for those @rally pranksters!
|
2070
2084
|
|
2071
|
-
\e[1m\e[33m @
|
2072
|
-
|
2073
|
-
|
2085
|
+
\e[1m\e[33m @ironicsans\e[0m
|
2086
|
+
If you like good real-life stories, check out @NarrativelyNY's just-launched
|
2087
|
+
site http://t.co/wiUL07jE (and also visit http://t.co/ZoyQxqWA)
|
2074
2088
|
|
2075
|
-
\e[1m\e[33m @
|
2076
|
-
|
2077
|
-
|
2089
|
+
\e[1m\e[33m @pat_shaughnessy\e[0m
|
2090
|
+
Something else to vote for: "New Rails workshops to bring more women into the
|
2091
|
+
Boston software scene" http://t.co/eNBuckHc /cc @bostonrb
|
2078
2092
|
|
2079
|
-
\e[1m\e[33m @
|
2080
|
-
|
2081
|
-
mystery. Today is a gift. That's why it's called the present.
|
2093
|
+
\e[1m\e[33m @calebelston\e[0m
|
2094
|
+
Pushing the button to launch the site. http://t.co/qLoEn5jG
|
2082
2095
|
|
2083
|
-
\e[1m\e[33m @
|
2084
|
-
@
|
2096
|
+
\e[1m\e[33m @calebelston\e[0m
|
2097
|
+
RT @olivercameron: Mosaic looks cool: http://t.co/A8013C9k
|
2085
2098
|
|
2086
|
-
\e[1m\e[33m @
|
2087
|
-
|
2099
|
+
\e[1m\e[33m @fivethirtyeight\e[0m
|
2100
|
+
The Weatherman is Not a Moron: http://t.co/ZwL5Gnq5. An excerpt from my book,
|
2101
|
+
THE SIGNAL AND THE NOISE (http://t.co/fNXj8vCE)
|
2088
2102
|
|
2089
|
-
\e[1m\e[33m @
|
2090
|
-
|
2103
|
+
\e[1m\e[33m @codeforamerica\e[0m
|
2104
|
+
RT @randomhacks: Going to Code Across Austin II: Y'all Come Hack Now, Sat,
|
2105
|
+
Sep 8 http://t.co/Sk5BM7U3 We'll see y'all there! #rhok @codeforamerica
|
2106
|
+
@TheaClay
|
2091
2107
|
|
2092
|
-
\e[1m\e[33m @
|
2093
|
-
|
2108
|
+
\e[1m\e[33m @fbjork\e[0m
|
2109
|
+
RT @jondot: Just published: "Pragmatic Concurrency With #Ruby"
|
2110
|
+
http://t.co/kGEykswZ /cc @JRuby @headius
|
2094
2111
|
|
2095
|
-
\e[1m\e[33m @
|
2096
|
-
|
2112
|
+
\e[1m\e[33m @mbostock\e[0m
|
2113
|
+
If you are wondering how we computed the split bubbles: http://t.co/BcaqSs5u
|
2097
2114
|
|
2098
|
-
\e[1m\e[33m @
|
2099
|
-
|
2100
|
-
a clever German. http://t.co/JvLNQCDm @skilldrick @hoverbird
|
2115
|
+
\e[1m\e[33m @FakeDorsey\e[0m
|
2116
|
+
“Write drunk. Edit sober.”—Ernest Hemingway
|
2101
2117
|
|
2102
|
-
\e[1m\e[33m @
|
2103
|
-
|
2118
|
+
\e[1m\e[33m @al3x\e[0m
|
2119
|
+
RT @wcmaier: Better banking through better ops: build something new with us
|
2120
|
+
@Simplify (remote, PDX) http://t.co/8WgzKZH3
|
2104
2121
|
|
2105
|
-
\e[1m\e[33m @
|
2106
|
-
|
2122
|
+
\e[1m\e[33m @calebelston\e[0m
|
2123
|
+
We just announced Mosaic, what we've been working on since the Yobongo
|
2124
|
+
acquisition. My personal post, http://t.co/ELOyIRZU @heymosaic
|
2107
2125
|
|
2108
|
-
\e[1m\e[33m @
|
2109
|
-
|
2126
|
+
\e[1m\e[33m @BarackObama\e[0m
|
2127
|
+
Donate $10 or more --> get your favorite car magnet: http://t.co/NfRhl2s2
|
2128
|
+
#Obama2012
|
2110
2129
|
|
2111
|
-
\e[1m\e[33m @
|
2112
|
-
|
2130
|
+
\e[1m\e[33m @JEG2\e[0m
|
2131
|
+
RT @tenderlove: If corporations are people, can we use them to drive in the
|
2132
|
+
carpool lane?
|
2113
2133
|
|
2114
|
-
\e[1m\e[33m @
|
2115
|
-
|
2134
|
+
\e[1m\e[33m @eveningedition\e[0m
|
2135
|
+
LDN—Obama's nomination; Putin woos APEC; Bombs hit Damascus; Quakes shake
|
2136
|
+
China; Canada cuts Iran ties; weekend read: http://t.co/OFs6dVW4
|
2116
2137
|
|
2117
|
-
\e[1m\e[33m @
|
2118
|
-
|
2119
|
-
|
2138
|
+
\e[1m\e[33m @dhh\e[0m
|
2139
|
+
RT @ggreenwald: Democrats parade Osama bin Laden's corpse as their proudest
|
2140
|
+
achievement: why this goulish jingoism is so warped http://t.co/kood278s
|
2120
2141
|
|
2121
|
-
\e[1m\e[33m @
|
2122
|
-
|
2123
|
-
|
2142
|
+
\e[1m\e[33m @jasonfried\e[0m
|
2143
|
+
The story of Mars Curiosity's gears, made by a factory in Rockford, IL:
|
2144
|
+
http://t.co/MwCRsHQg
|
2124
2145
|
|
2125
|
-
\e[1m\e[33m @
|
2126
|
-
@
|
2146
|
+
\e[1m\e[33m @sferik\e[0m
|
2147
|
+
@episod @twitterapi now https://t.co/I17jUTu2 and https://t.co/deDu4Hgw seem
|
2148
|
+
to be missing "1.1" from the URL.
|
2127
2149
|
|
2128
|
-
\e[1m\e[33m @
|
2129
|
-
@
|
2150
|
+
\e[1m\e[33m @sferik\e[0m
|
2151
|
+
@episod @twitterapi Did you catch https://t.co/VHsQvZT0 as well?
|
2130
2152
|
|
2131
|
-
\e[1m\e[33m @
|
2132
|
-
|
2133
|
-
|
2153
|
+
\e[1m\e[33m @dwiskus\e[0m
|
2154
|
+
Gentlemen, you can't fight in here! This is the war room!
|
2155
|
+
http://t.co/kMxMYyqF
|
2134
2156
|
|
2135
2157
|
eos
|
2136
2158
|
end
|
@@ -2142,26 +2164,26 @@ ID Created at Screen name Slug Members Subscribers ...
|
|
2142
2164
|
@cli.mentions
|
2143
2165
|
$stdout.string.should == <<-eos
|
2144
2166
|
ID,Posted at,Screen name,Text
|
2145
|
-
|
2146
|
-
|
2147
|
-
|
2148
|
-
|
2149
|
-
|
2150
|
-
|
2151
|
-
|
2152
|
-
|
2153
|
-
|
2154
|
-
|
2155
|
-
|
2156
|
-
|
2157
|
-
|
2158
|
-
|
2159
|
-
|
2160
|
-
|
2161
|
-
|
2162
|
-
|
2163
|
-
|
2164
|
-
|
2167
|
+
244111636544225280,2012-09-07 16:35:24 +0000,mutgoff,Happy Birthday @imdane. Watch out for those @rally pranksters!
|
2168
|
+
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)"
|
2169
|
+
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"
|
2170
|
+
244109797308379136,2012-09-07 16:28:05 +0000,calebelston,Pushing the button to launch the site. http://t.co/qLoEn5jG
|
2171
|
+
244108728834592770,2012-09-07 16:23:50 +0000,calebelston,RT @olivercameron: Mosaic looks cool: http://t.co/A8013C9k
|
2172
|
+
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)"
|
2173
|
+
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"
|
2174
|
+
244107236262170624,2012-09-07 16:17:55 +0000,fbjork,"RT @jondot: Just published: ""Pragmatic Concurrency With #Ruby"" http://t.co/kGEykswZ /cc @JRuby @headius"
|
2175
|
+
244106476048764928,2012-09-07 16:14:53 +0000,mbostock,If you are wondering how we computed the split bubbles: http://t.co/BcaqSs5u
|
2176
|
+
244105599351148544,2012-09-07 16:11:24 +0000,FakeDorsey,“Write drunk. Edit sober.”—Ernest Hemingway
|
2177
|
+
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"
|
2178
|
+
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"
|
2179
|
+
244103057175113729,2012-09-07 16:01:18 +0000,BarackObama,Donate $10 or more --> get your favorite car magnet: http://t.co/NfRhl2s2 #Obama2012
|
2180
|
+
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?"
|
2181
|
+
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
|
2182
|
+
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
|
2183
|
+
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"
|
2184
|
+
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."
|
2185
|
+
244100411563339777,2012-09-07 15:50:47 +0000,sferik,@episod @twitterapi Did you catch https://t.co/VHsQvZT0 as well?
|
2186
|
+
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"
|
2165
2187
|
eos
|
2166
2188
|
end
|
2167
2189
|
end
|
@@ -2172,27 +2194,27 @@ ID,Posted at,Screen name,Text
|
|
2172
2194
|
it "should output in long format" do
|
2173
2195
|
@cli.mentions
|
2174
2196
|
$stdout.string.should == <<-eos
|
2175
|
-
ID Posted at Screen name
|
2176
|
-
|
2177
|
-
|
2178
|
-
|
2179
|
-
|
2180
|
-
|
2181
|
-
|
2182
|
-
|
2183
|
-
|
2184
|
-
|
2185
|
-
|
2186
|
-
|
2187
|
-
|
2188
|
-
|
2189
|
-
|
2190
|
-
|
2191
|
-
|
2192
|
-
|
2193
|
-
|
2194
|
-
|
2195
|
-
|
2197
|
+
ID Posted at Screen name Text
|
2198
|
+
244111636544225280 Sep 7 08:35 @mutgoff Happy Birthday @imdane. W...
|
2199
|
+
244111183165157376 Sep 7 08:33 @ironicsans If you like good real-lif...
|
2200
|
+
244110336414859264 Sep 7 08:30 @pat_shaughnessy Something else to vote fo...
|
2201
|
+
244109797308379136 Sep 7 08:28 @calebelston Pushing the button to lau...
|
2202
|
+
244108728834592770 Sep 7 08:23 @calebelston RT @olivercameron: Mosaic...
|
2203
|
+
244107890632294400 Sep 7 08:20 @fivethirtyeight The Weatherman is Not a M...
|
2204
|
+
244107823733174272 Sep 7 08:20 @codeforamerica RT @randomhacks: Going to...
|
2205
|
+
244107236262170624 Sep 7 08:17 @fbjork RT @jondot: Just publishe...
|
2206
|
+
244106476048764928 Sep 7 08:14 @mbostock If you are wondering how ...
|
2207
|
+
244105599351148544 Sep 7 08:11 @FakeDorsey “Write drunk. Edit sober....
|
2208
|
+
244104558433951744 Sep 7 08:07 @al3x RT @wcmaier: Better banki...
|
2209
|
+
244104146997870594 Sep 7 08:05 @calebelston We just announced Mosaic,...
|
2210
|
+
244103057175113729 Sep 7 08:01 @BarackObama Donate $10 or more --> ge...
|
2211
|
+
244102834398851073 Sep 7 08:00 @JEG2 RT @tenderlove: If corpor...
|
2212
|
+
244102741125890048 Sep 7 08:00 @eveningedition LDN—Obama's nomination; P...
|
2213
|
+
244102729860009984 Sep 7 08:00 @dhh RT @ggreenwald: Democrats...
|
2214
|
+
244102490646278146 Sep 7 07:59 @jasonfried The story of Mars Curiosi...
|
2215
|
+
244102209942458368 Sep 7 07:57 @sferik @episod @twitterapi now h...
|
2216
|
+
244100411563339777 Sep 7 07:50 @sferik @episod @twitterapi Did y...
|
2217
|
+
244099460672679938 Sep 7 07:47 @dwiskus Gentlemen, you can't figh...
|
2196
2218
|
eos
|
2197
2219
|
end
|
2198
2220
|
context "--reverse" do
|
@@ -2202,67 +2224,67 @@ ID Posted at Screen name Text
|
|
2202
2224
|
it "should reverse the order of the sort" do
|
2203
2225
|
@cli.mentions
|
2204
2226
|
$stdout.string.should == <<-eos
|
2205
|
-
ID Posted at Screen name
|
2206
|
-
|
2207
|
-
|
2208
|
-
|
2209
|
-
|
2210
|
-
|
2211
|
-
|
2212
|
-
|
2213
|
-
|
2214
|
-
|
2215
|
-
|
2216
|
-
|
2217
|
-
|
2218
|
-
|
2219
|
-
|
2220
|
-
|
2221
|
-
|
2222
|
-
|
2223
|
-
|
2224
|
-
|
2225
|
-
|
2227
|
+
ID Posted at Screen name Text
|
2228
|
+
244099460672679938 Sep 7 07:47 @dwiskus Gentlemen, you can't figh...
|
2229
|
+
244100411563339777 Sep 7 07:50 @sferik @episod @twitterapi Did y...
|
2230
|
+
244102209942458368 Sep 7 07:57 @sferik @episod @twitterapi now h...
|
2231
|
+
244102490646278146 Sep 7 07:59 @jasonfried The story of Mars Curiosi...
|
2232
|
+
244102729860009984 Sep 7 08:00 @dhh RT @ggreenwald: Democrats...
|
2233
|
+
244102741125890048 Sep 7 08:00 @eveningedition LDN—Obama's nomination; P...
|
2234
|
+
244102834398851073 Sep 7 08:00 @JEG2 RT @tenderlove: If corpor...
|
2235
|
+
244103057175113729 Sep 7 08:01 @BarackObama Donate $10 or more --> ge...
|
2236
|
+
244104146997870594 Sep 7 08:05 @calebelston We just announced Mosaic,...
|
2237
|
+
244104558433951744 Sep 7 08:07 @al3x RT @wcmaier: Better banki...
|
2238
|
+
244105599351148544 Sep 7 08:11 @FakeDorsey “Write drunk. Edit sober....
|
2239
|
+
244106476048764928 Sep 7 08:14 @mbostock If you are wondering how ...
|
2240
|
+
244107236262170624 Sep 7 08:17 @fbjork RT @jondot: Just publishe...
|
2241
|
+
244107823733174272 Sep 7 08:20 @codeforamerica RT @randomhacks: Going to...
|
2242
|
+
244107890632294400 Sep 7 08:20 @fivethirtyeight The Weatherman is Not a M...
|
2243
|
+
244108728834592770 Sep 7 08:23 @calebelston RT @olivercameron: Mosaic...
|
2244
|
+
244109797308379136 Sep 7 08:28 @calebelston Pushing the button to lau...
|
2245
|
+
244110336414859264 Sep 7 08:30 @pat_shaughnessy Something else to vote fo...
|
2246
|
+
244111183165157376 Sep 7 08:33 @ironicsans If you like good real-lif...
|
2247
|
+
244111636544225280 Sep 7 08:35 @mutgoff Happy Birthday @imdane. W...
|
2226
2248
|
eos
|
2227
2249
|
end
|
2228
2250
|
end
|
2229
2251
|
end
|
2230
2252
|
context "--number" do
|
2231
2253
|
before do
|
2232
|
-
stub_get("/1/statuses/
|
2254
|
+
stub_get("/1.1/statuses/mentions_timeline.json").
|
2233
2255
|
with(:query => {:count => "1"}).
|
2234
2256
|
to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
2235
|
-
stub_get("/1/statuses/
|
2257
|
+
stub_get("/1.1/statuses/mentions_timeline.json").
|
2236
2258
|
with(:query => {:count => "200"}).
|
2237
2259
|
to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
2238
|
-
stub_get("/1/statuses/
|
2239
|
-
with(:query => {:count => "200", :max_id => "
|
2260
|
+
stub_get("/1.1/statuses/mentions_timeline.json").
|
2261
|
+
with(:query => {:count => "200", :max_id => "244099460672679937"}).
|
2240
2262
|
to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
2241
2263
|
(5..185).step(20).to_a.reverse.each do |count|
|
2242
|
-
stub_get("/1/statuses/
|
2243
|
-
with(:query => {:count => count, :max_id => "
|
2264
|
+
stub_get("/1.1/statuses/mentions_timeline.json").
|
2265
|
+
with(:query => {:count => count, :max_id => "244099460672679937"}).
|
2244
2266
|
to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
2245
2267
|
end
|
2246
2268
|
end
|
2247
2269
|
it "should limit the number of results to 1" do
|
2248
2270
|
@cli.options = @cli.options.merge("number" => 1)
|
2249
2271
|
@cli.mentions
|
2250
|
-
a_get("/1/statuses/
|
2272
|
+
a_get("/1.1/statuses/mentions_timeline.json").
|
2251
2273
|
with(:query => {:count => "1"}).
|
2252
2274
|
should have_been_made
|
2253
2275
|
end
|
2254
2276
|
it "should limit the number of results to 345" do
|
2255
2277
|
@cli.options = @cli.options.merge("number" => 345)
|
2256
2278
|
@cli.mentions
|
2257
|
-
a_get("/1/statuses/
|
2279
|
+
a_get("/1.1/statuses/mentions_timeline.json").
|
2258
2280
|
with(:query => {:count => "200"}).
|
2259
2281
|
should have_been_made
|
2260
|
-
a_get("/1/statuses/
|
2261
|
-
with(:query => {:count => "200", :max_id => "
|
2282
|
+
a_get("/1.1/statuses/mentions_timeline.json").
|
2283
|
+
with(:query => {:count => "200", :max_id => "244099460672679937"}).
|
2262
2284
|
should have_been_made.times(7)
|
2263
2285
|
(5..185).step(20).to_a.reverse.each do |count|
|
2264
|
-
a_get("/1/statuses/
|
2265
|
-
with(:query => {:count => count, :max_id => "
|
2286
|
+
a_get("/1.1/statuses/mentions_timeline.json").
|
2287
|
+
with(:query => {:count => count, :max_id => "244099460672679937"}).
|
2266
2288
|
should have_been_made
|
2267
2289
|
end
|
2268
2290
|
end
|
@@ -2281,13 +2303,13 @@ ID Posted at Screen name Text
|
|
2281
2303
|
context "--id" do
|
2282
2304
|
before do
|
2283
2305
|
@cli.options = @cli.options.merge("id" => true)
|
2284
|
-
stub_get("/1/users/show.json").
|
2306
|
+
stub_get("/1.1/users/show.json").
|
2285
2307
|
with(:query => {:user_id => "420"}).
|
2286
2308
|
to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
2287
2309
|
end
|
2288
2310
|
it "should request the correct resource" do
|
2289
2311
|
@cli.open("420")
|
2290
|
-
a_get("/1/users/show.json").
|
2312
|
+
a_get("/1.1/users/show.json").
|
2291
2313
|
with(:query => {:user_id => "420"}).
|
2292
2314
|
should have_been_made
|
2293
2315
|
end
|
@@ -2295,13 +2317,13 @@ ID Posted at Screen name Text
|
|
2295
2317
|
context "--status" do
|
2296
2318
|
before do
|
2297
2319
|
@cli.options = @cli.options.merge("status" => true)
|
2298
|
-
stub_get("/1/statuses/show/55709764298092545.json").
|
2320
|
+
stub_get("/1.1/statuses/show/55709764298092545.json").
|
2299
2321
|
with(:query => {:include_my_retweet => "false"}).
|
2300
2322
|
to_return(:body => fixture("status.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
2301
2323
|
end
|
2302
2324
|
it "should request the correct resource" do
|
2303
2325
|
@cli.open("55709764298092545")
|
2304
|
-
a_get("/1/statuses/show/55709764298092545.json").
|
2326
|
+
a_get("/1.1/statuses/show/55709764298092545.json").
|
2305
2327
|
with(:query => {:include_my_retweet => "false"}).
|
2306
2328
|
should have_been_made
|
2307
2329
|
end
|
@@ -2313,45 +2335,13 @@ ID Posted at Screen name Text
|
|
2313
2335
|
end
|
2314
2336
|
end
|
2315
2337
|
|
2316
|
-
describe "#rate_limit" do
|
2317
|
-
before do
|
2318
|
-
stub_get("/1/account/rate_limit_status.json").
|
2319
|
-
to_return(:body => fixture("rate_limit_status.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
2320
|
-
end
|
2321
|
-
it "should request the correct resource" do
|
2322
|
-
@cli.rate_limit
|
2323
|
-
a_get("/1/account/rate_limit_status.json").
|
2324
|
-
should have_been_made
|
2325
|
-
end
|
2326
|
-
it "should have the correct output" do
|
2327
|
-
@cli.rate_limit
|
2328
|
-
$stdout.string.should == <<-eos
|
2329
|
-
Hourly limit 20,000
|
2330
|
-
Remaining hits 19,993
|
2331
|
-
Reset time Oct 26 2010 (a year from now)
|
2332
|
-
eos
|
2333
|
-
end
|
2334
|
-
context "--csv" do
|
2335
|
-
before do
|
2336
|
-
@cli.options = @cli.options.merge("csv" => true)
|
2337
|
-
end
|
2338
|
-
it "should have the correct output" do
|
2339
|
-
@cli.rate_limit
|
2340
|
-
$stdout.string.should == <<-eos
|
2341
|
-
Hourly limit,Remaining hits,Reset time
|
2342
|
-
20000,19993,2010-10-26 12:43:08 +0000
|
2343
|
-
eos
|
2344
|
-
end
|
2345
|
-
end
|
2346
|
-
end
|
2347
|
-
|
2348
2338
|
describe "#reply" do
|
2349
2339
|
before do
|
2350
2340
|
@cli.options = @cli.options.merge("profile" => fixture_path + "/.trc", "location" => true)
|
2351
|
-
stub_get("/1/statuses/show/55709764298092545.json").
|
2341
|
+
stub_get("/1.1/statuses/show/55709764298092545.json").
|
2352
2342
|
with(:query => {:include_my_retweet => "false"}).
|
2353
2343
|
to_return(:body => fixture("status.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
2354
|
-
stub_post("/1/statuses/update.json").
|
2344
|
+
stub_post("/1.1/statuses/update.json").
|
2355
2345
|
with(:body => {:in_reply_to_status_id => "55709764298092545", :status => "@sferik Testing", :lat => "37.76969909668", :long => "-122.39330291748", :trim_user => "true"}).
|
2356
2346
|
to_return(:body => fixture("status.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
2357
2347
|
stub_request(:get, "http://checkip.dyndns.org/").
|
@@ -2361,10 +2351,10 @@ Hourly limit,Remaining hits,Reset time
|
|
2361
2351
|
end
|
2362
2352
|
it "should request the correct resource" do
|
2363
2353
|
@cli.reply("55709764298092545", "Testing")
|
2364
|
-
a_get("/1/statuses/show/55709764298092545.json").
|
2354
|
+
a_get("/1.1/statuses/show/55709764298092545.json").
|
2365
2355
|
with(:query => {:include_my_retweet => "false"}).
|
2366
2356
|
should have_been_made
|
2367
|
-
a_post("/1/statuses/update.json").
|
2357
|
+
a_post("/1.1/statuses/update.json").
|
2368
2358
|
with(:body => {:in_reply_to_status_id => "55709764298092545", :status => "@sferik Testing", :lat => "37.76969909668", :long => "-122.39330291748", :trim_user => "true"}).
|
2369
2359
|
should have_been_made
|
2370
2360
|
a_request(:get, "http://checkip.dyndns.org/").
|
@@ -2382,10 +2372,10 @@ Hourly limit,Remaining hits,Reset time
|
|
2382
2372
|
end
|
2383
2373
|
it "should request the correct resource" do
|
2384
2374
|
@cli.reply("55709764298092545", "Testing")
|
2385
|
-
a_get("/1/statuses/show/55709764298092545.json").
|
2375
|
+
a_get("/1.1/statuses/show/55709764298092545.json").
|
2386
2376
|
with(:query => {:include_my_retweet => "false"}).
|
2387
2377
|
should have_been_made
|
2388
|
-
a_post("/1/statuses/update.json").
|
2378
|
+
a_post("/1.1/statuses/update.json").
|
2389
2379
|
with(:body => {:in_reply_to_status_id => "55709764298092545", :status => "@sferik Testing", :lat => "37.76969909668", :long => "-122.39330291748", :trim_user => "true"}).
|
2390
2380
|
should have_been_made
|
2391
2381
|
a_request(:get, "http://checkip.dyndns.org/").
|
@@ -2403,13 +2393,13 @@ Hourly limit,Remaining hits,Reset time
|
|
2403
2393
|
describe "#report_spam" do
|
2404
2394
|
before do
|
2405
2395
|
@cli.options = @cli.options.merge("profile" => fixture_path + "/.trc")
|
2406
|
-
stub_post("/1/report_spam.json").
|
2396
|
+
stub_post("/1.1/report_spam.json").
|
2407
2397
|
with(:body => {:screen_name => "sferik"}).
|
2408
2398
|
to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
2409
2399
|
end
|
2410
2400
|
it "should request the correct resource" do
|
2411
2401
|
@cli.report_spam("sferik")
|
2412
|
-
a_post("/1/report_spam.json").
|
2402
|
+
a_post("/1.1/report_spam.json").
|
2413
2403
|
with(:body => {:screen_name => "sferik"}).
|
2414
2404
|
should have_been_made
|
2415
2405
|
end
|
@@ -2420,13 +2410,13 @@ Hourly limit,Remaining hits,Reset time
|
|
2420
2410
|
context "--id" do
|
2421
2411
|
before do
|
2422
2412
|
@cli.options = @cli.options.merge("id" => true)
|
2423
|
-
stub_post("/1/report_spam.json").
|
2413
|
+
stub_post("/1.1/report_spam.json").
|
2424
2414
|
with(:body => {:user_id => "7505382"}).
|
2425
2415
|
to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
2426
2416
|
end
|
2427
2417
|
it "should request the correct resource" do
|
2428
2418
|
@cli.report_spam("7505382")
|
2429
|
-
a_post("/1/report_spam.json").
|
2419
|
+
a_post("/1.1/report_spam.json").
|
2430
2420
|
with(:body => {:user_id => "7505382"}).
|
2431
2421
|
should have_been_made
|
2432
2422
|
end
|
@@ -2436,12 +2426,12 @@ Hourly limit,Remaining hits,Reset time
|
|
2436
2426
|
describe "#retweet" do
|
2437
2427
|
before do
|
2438
2428
|
@cli.options = @cli.options.merge("profile" => fixture_path + "/.trc")
|
2439
|
-
stub_post("/1/statuses/retweet/26755176471724032.json").
|
2429
|
+
stub_post("/1.1/statuses/retweet/26755176471724032.json").
|
2440
2430
|
to_return(:body => fixture("retweet.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
2441
2431
|
end
|
2442
2432
|
it "should request the correct resource" do
|
2443
2433
|
@cli.retweet("26755176471724032")
|
2444
|
-
a_post("/1/statuses/retweet/26755176471724032.json").
|
2434
|
+
a_post("/1.1/statuses/retweet/26755176471724032.json").
|
2445
2435
|
should have_been_made
|
2446
2436
|
end
|
2447
2437
|
it "should have the correct output" do
|
@@ -2452,87 +2442,105 @@ Hourly limit,Remaining hits,Reset time
|
|
2452
2442
|
|
2453
2443
|
describe "#retweets" do
|
2454
2444
|
before do
|
2455
|
-
stub_get("/1/statuses/
|
2456
|
-
with(:query => {:count => "
|
2445
|
+
stub_get("/1.1/statuses/user_timeline.json").
|
2446
|
+
with(:query => {:count => "200", :include_rts => "true"}).
|
2447
|
+
to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
2448
|
+
stub_get("/1.1/statuses/user_timeline.json").
|
2449
|
+
with(:query => {:count => "200", :include_rts => "true", :max_id => "244102729860009983"}).
|
2457
2450
|
to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
2458
2451
|
end
|
2459
2452
|
context "without arguments" do
|
2460
2453
|
it "should request the correct resource" do
|
2461
2454
|
@cli.retweets
|
2462
|
-
a_get("/1/statuses/
|
2463
|
-
with(:query => {:count => "
|
2455
|
+
a_get("/1.1/statuses/user_timeline.json").
|
2456
|
+
with(:query => {:count => "200", :include_rts => "true"}).
|
2464
2457
|
should have_been_made
|
2458
|
+
a_get("/1.1/statuses/user_timeline.json").
|
2459
|
+
with(:query => {:count => "200", :include_rts => "true", :max_id => "244102729860009983"}).
|
2460
|
+
should have_been_made.times(3)
|
2465
2461
|
end
|
2466
2462
|
it "should have the correct output" do
|
2467
2463
|
@cli.retweets
|
2468
2464
|
$stdout.string.should == <<-eos
|
2469
|
-
\e[1m\e[33m @
|
2470
|
-
|
2471
|
-
CI, the element Oxygen.
|
2465
|
+
\e[1m\e[33m @calebelston\e[0m
|
2466
|
+
RT @olivercameron: Mosaic looks cool: http://t.co/A8013C9k
|
2472
2467
|
|
2473
|
-
\e[1m\e[33m @
|
2474
|
-
|
2475
|
-
|
2468
|
+
\e[1m\e[33m @codeforamerica\e[0m
|
2469
|
+
RT @randomhacks: Going to Code Across Austin II: Y'all Come Hack Now, Sat,
|
2470
|
+
Sep 8 http://t.co/Sk5BM7U3 We'll see y'all there! #rhok @codeforamerica
|
2471
|
+
@TheaClay
|
2476
2472
|
|
2477
|
-
\e[1m\e[33m @
|
2478
|
-
|
2479
|
-
|
2473
|
+
\e[1m\e[33m @fbjork\e[0m
|
2474
|
+
RT @jondot: Just published: "Pragmatic Concurrency With #Ruby"
|
2475
|
+
http://t.co/kGEykswZ /cc @JRuby @headius
|
2480
2476
|
|
2481
|
-
\e[1m\e[33m @
|
2482
|
-
RT @
|
2483
|
-
|
2477
|
+
\e[1m\e[33m @al3x\e[0m
|
2478
|
+
RT @wcmaier: Better banking through better ops: build something new with us
|
2479
|
+
@Simplify (remote, PDX) http://t.co/8WgzKZH3
|
2484
2480
|
|
2485
|
-
\e[1m\e[33m @
|
2486
|
-
@
|
2481
|
+
\e[1m\e[33m @JEG2\e[0m
|
2482
|
+
RT @tenderlove: If corporations are people, can we use them to drive in the
|
2483
|
+
carpool lane?
|
2487
2484
|
|
2488
|
-
\e[1m\e[33m @
|
2489
|
-
@
|
2485
|
+
\e[1m\e[33m @dhh\e[0m
|
2486
|
+
RT @ggreenwald: Democrats parade Osama bin Laden's corpse as their proudest
|
2487
|
+
achievement: why this goulish jingoism is so warped http://t.co/kood278s
|
2490
2488
|
|
2491
|
-
\e[1m\e[33m @
|
2492
|
-
|
2489
|
+
\e[1m\e[33m @calebelston\e[0m
|
2490
|
+
RT @olivercameron: Mosaic looks cool: http://t.co/A8013C9k
|
2493
2491
|
|
2494
|
-
\e[1m\e[33m @
|
2495
|
-
|
2492
|
+
\e[1m\e[33m @codeforamerica\e[0m
|
2493
|
+
RT @randomhacks: Going to Code Across Austin II: Y'all Come Hack Now, Sat,
|
2494
|
+
Sep 8 http://t.co/Sk5BM7U3 We'll see y'all there! #rhok @codeforamerica
|
2495
|
+
@TheaClay
|
2496
2496
|
|
2497
|
-
\e[1m\e[33m @
|
2498
|
-
|
2497
|
+
\e[1m\e[33m @fbjork\e[0m
|
2498
|
+
RT @jondot: Just published: "Pragmatic Concurrency With #Ruby"
|
2499
|
+
http://t.co/kGEykswZ /cc @JRuby @headius
|
2499
2500
|
|
2500
|
-
\e[1m\e[33m @
|
2501
|
-
@
|
2502
|
-
|
2501
|
+
\e[1m\e[33m @al3x\e[0m
|
2502
|
+
RT @wcmaier: Better banking through better ops: build something new with us
|
2503
|
+
@Simplify (remote, PDX) http://t.co/8WgzKZH3
|
2503
2504
|
|
2504
|
-
\e[1m\e[33m @
|
2505
|
-
|
2505
|
+
\e[1m\e[33m @JEG2\e[0m
|
2506
|
+
RT @tenderlove: If corporations are people, can we use them to drive in the
|
2507
|
+
carpool lane?
|
2506
2508
|
|
2507
|
-
\e[1m\e[33m @
|
2508
|
-
|
2509
|
+
\e[1m\e[33m @dhh\e[0m
|
2510
|
+
RT @ggreenwald: Democrats parade Osama bin Laden's corpse as their proudest
|
2511
|
+
achievement: why this goulish jingoism is so warped http://t.co/kood278s
|
2509
2512
|
|
2510
|
-
\e[1m\e[33m @
|
2511
|
-
@
|
2513
|
+
\e[1m\e[33m @calebelston\e[0m
|
2514
|
+
RT @olivercameron: Mosaic looks cool: http://t.co/A8013C9k
|
2512
2515
|
|
2513
|
-
\e[1m\e[33m @
|
2514
|
-
|
2516
|
+
\e[1m\e[33m @codeforamerica\e[0m
|
2517
|
+
RT @randomhacks: Going to Code Across Austin II: Y'all Come Hack Now, Sat,
|
2518
|
+
Sep 8 http://t.co/Sk5BM7U3 We'll see y'all there! #rhok @codeforamerica
|
2519
|
+
@TheaClay
|
2515
2520
|
|
2516
|
-
\e[1m\e[33m @
|
2517
|
-
|
2521
|
+
\e[1m\e[33m @fbjork\e[0m
|
2522
|
+
RT @jondot: Just published: "Pragmatic Concurrency With #Ruby"
|
2523
|
+
http://t.co/kGEykswZ /cc @JRuby @headius
|
2518
2524
|
|
2519
|
-
\e[1m\e[33m @
|
2520
|
-
|
2521
|
-
|
2525
|
+
\e[1m\e[33m @al3x\e[0m
|
2526
|
+
RT @wcmaier: Better banking through better ops: build something new with us
|
2527
|
+
@Simplify (remote, PDX) http://t.co/8WgzKZH3
|
2522
2528
|
|
2523
|
-
\e[1m\e[33m @
|
2524
|
-
|
2525
|
-
|
2529
|
+
\e[1m\e[33m @JEG2\e[0m
|
2530
|
+
RT @tenderlove: If corporations are people, can we use them to drive in the
|
2531
|
+
carpool lane?
|
2526
2532
|
|
2527
|
-
\e[1m\e[33m @
|
2528
|
-
@
|
2533
|
+
\e[1m\e[33m @dhh\e[0m
|
2534
|
+
RT @ggreenwald: Democrats parade Osama bin Laden's corpse as their proudest
|
2535
|
+
achievement: why this goulish jingoism is so warped http://t.co/kood278s
|
2529
2536
|
|
2530
|
-
\e[1m\e[33m @
|
2531
|
-
|
2537
|
+
\e[1m\e[33m @calebelston\e[0m
|
2538
|
+
RT @olivercameron: Mosaic looks cool: http://t.co/A8013C9k
|
2532
2539
|
|
2533
|
-
\e[1m\e[33m @
|
2534
|
-
|
2535
|
-
|
2540
|
+
\e[1m\e[33m @codeforamerica\e[0m
|
2541
|
+
RT @randomhacks: Going to Code Across Austin II: Y'all Come Hack Now, Sat,
|
2542
|
+
Sep 8 http://t.co/Sk5BM7U3 We'll see y'all there! #rhok @codeforamerica
|
2543
|
+
@TheaClay
|
2536
2544
|
|
2537
2545
|
eos
|
2538
2546
|
end
|
@@ -2545,27 +2553,27 @@ Hourly limit,Remaining hits,Reset time
|
|
2545
2553
|
@cli.retweets
|
2546
2554
|
$stdout.string.should == <<-eos
|
2547
2555
|
ID,Posted at,Screen name,Text
|
2548
|
-
|
2549
|
-
|
2550
|
-
|
2551
|
-
|
2552
|
-
|
2553
|
-
|
2554
|
-
|
2555
|
-
|
2556
|
-
|
2557
|
-
|
2558
|
-
|
2559
|
-
|
2560
|
-
|
2561
|
-
|
2562
|
-
|
2563
|
-
|
2564
|
-
|
2565
|
-
|
2566
|
-
|
2567
|
-
|
2568
|
-
|
2556
|
+
244108728834592770,2012-09-07 16:23:50 +0000,calebelston,RT @olivercameron: Mosaic looks cool: http://t.co/A8013C9k
|
2557
|
+
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"
|
2558
|
+
244107236262170624,2012-09-07 16:17:55 +0000,fbjork,"RT @jondot: Just published: ""Pragmatic Concurrency With #Ruby"" http://t.co/kGEykswZ /cc @JRuby @headius"
|
2559
|
+
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"
|
2560
|
+
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?"
|
2561
|
+
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
|
2562
|
+
244108728834592770,2012-09-07 16:23:50 +0000,calebelston,RT @olivercameron: Mosaic looks cool: http://t.co/A8013C9k
|
2563
|
+
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"
|
2564
|
+
244107236262170624,2012-09-07 16:17:55 +0000,fbjork,"RT @jondot: Just published: ""Pragmatic Concurrency With #Ruby"" http://t.co/kGEykswZ /cc @JRuby @headius"
|
2565
|
+
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"
|
2566
|
+
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?"
|
2567
|
+
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
|
2568
|
+
244108728834592770,2012-09-07 16:23:50 +0000,calebelston,RT @olivercameron: Mosaic looks cool: http://t.co/A8013C9k
|
2569
|
+
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"
|
2570
|
+
244107236262170624,2012-09-07 16:17:55 +0000,fbjork,"RT @jondot: Just published: ""Pragmatic Concurrency With #Ruby"" http://t.co/kGEykswZ /cc @JRuby @headius"
|
2571
|
+
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"
|
2572
|
+
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?"
|
2573
|
+
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
|
2574
|
+
244108728834592770,2012-09-07 16:23:50 +0000,calebelston,RT @olivercameron: Mosaic looks cool: http://t.co/A8013C9k
|
2575
|
+
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"
|
2576
|
+
eos
|
2569
2577
|
end
|
2570
2578
|
end
|
2571
2579
|
context "--long" do
|
@@ -2575,27 +2583,27 @@ ID,Posted at,Screen name,Text
|
|
2575
2583
|
it "should output in long format" do
|
2576
2584
|
@cli.retweets
|
2577
2585
|
$stdout.string.should == <<-eos
|
2578
|
-
ID Posted at Screen name
|
2579
|
-
|
2580
|
-
|
2581
|
-
|
2582
|
-
|
2583
|
-
|
2584
|
-
|
2585
|
-
|
2586
|
-
|
2587
|
-
|
2588
|
-
|
2589
|
-
|
2590
|
-
|
2591
|
-
|
2592
|
-
|
2593
|
-
|
2594
|
-
|
2595
|
-
|
2596
|
-
|
2597
|
-
|
2598
|
-
|
2586
|
+
ID Posted at Screen name Text
|
2587
|
+
244108728834592770 Sep 7 08:23 @calebelston RT @olivercameron: Mosaic ...
|
2588
|
+
244107823733174272 Sep 7 08:20 @codeforamerica RT @randomhacks: Going to ...
|
2589
|
+
244107236262170624 Sep 7 08:17 @fbjork RT @jondot: Just published...
|
2590
|
+
244104558433951744 Sep 7 08:07 @al3x RT @wcmaier: Better bankin...
|
2591
|
+
244102834398851073 Sep 7 08:00 @JEG2 RT @tenderlove: If corpora...
|
2592
|
+
244102729860009984 Sep 7 08:00 @dhh RT @ggreenwald: Democrats ...
|
2593
|
+
244108728834592770 Sep 7 08:23 @calebelston RT @olivercameron: Mosaic ...
|
2594
|
+
244107823733174272 Sep 7 08:20 @codeforamerica RT @randomhacks: Going to ...
|
2595
|
+
244107236262170624 Sep 7 08:17 @fbjork RT @jondot: Just published...
|
2596
|
+
244104558433951744 Sep 7 08:07 @al3x RT @wcmaier: Better bankin...
|
2597
|
+
244102834398851073 Sep 7 08:00 @JEG2 RT @tenderlove: If corpora...
|
2598
|
+
244102729860009984 Sep 7 08:00 @dhh RT @ggreenwald: Democrats ...
|
2599
|
+
244108728834592770 Sep 7 08:23 @calebelston RT @olivercameron: Mosaic ...
|
2600
|
+
244107823733174272 Sep 7 08:20 @codeforamerica RT @randomhacks: Going to ...
|
2601
|
+
244107236262170624 Sep 7 08:17 @fbjork RT @jondot: Just published...
|
2602
|
+
244104558433951744 Sep 7 08:07 @al3x RT @wcmaier: Better bankin...
|
2603
|
+
244102834398851073 Sep 7 08:00 @JEG2 RT @tenderlove: If corpora...
|
2604
|
+
244102729860009984 Sep 7 08:00 @dhh RT @ggreenwald: Democrats ...
|
2605
|
+
244108728834592770 Sep 7 08:23 @calebelston RT @olivercameron: Mosaic ...
|
2606
|
+
244107823733174272 Sep 7 08:20 @codeforamerica RT @randomhacks: Going to ...
|
2599
2607
|
eos
|
2600
2608
|
end
|
2601
2609
|
context "--reverse" do
|
@@ -2605,95 +2613,94 @@ ID Posted at Screen name Text
|
|
2605
2613
|
it "should reverse the order of the sort" do
|
2606
2614
|
@cli.retweets
|
2607
2615
|
$stdout.string.should == <<-eos
|
2608
|
-
ID Posted at Screen name
|
2609
|
-
|
2610
|
-
|
2611
|
-
|
2612
|
-
|
2613
|
-
|
2614
|
-
|
2615
|
-
|
2616
|
-
|
2617
|
-
|
2618
|
-
|
2619
|
-
|
2620
|
-
|
2621
|
-
|
2622
|
-
|
2623
|
-
|
2624
|
-
|
2625
|
-
|
2626
|
-
|
2627
|
-
|
2628
|
-
|
2616
|
+
ID Posted at Screen name Text
|
2617
|
+
244107823733174272 Sep 7 08:20 @codeforamerica RT @randomhacks: Going to ...
|
2618
|
+
244108728834592770 Sep 7 08:23 @calebelston RT @olivercameron: Mosaic ...
|
2619
|
+
244102729860009984 Sep 7 08:00 @dhh RT @ggreenwald: Democrats ...
|
2620
|
+
244102834398851073 Sep 7 08:00 @JEG2 RT @tenderlove: If corpora...
|
2621
|
+
244104558433951744 Sep 7 08:07 @al3x RT @wcmaier: Better bankin...
|
2622
|
+
244107236262170624 Sep 7 08:17 @fbjork RT @jondot: Just published...
|
2623
|
+
244107823733174272 Sep 7 08:20 @codeforamerica RT @randomhacks: Going to ...
|
2624
|
+
244108728834592770 Sep 7 08:23 @calebelston RT @olivercameron: Mosaic ...
|
2625
|
+
244102729860009984 Sep 7 08:00 @dhh RT @ggreenwald: Democrats ...
|
2626
|
+
244102834398851073 Sep 7 08:00 @JEG2 RT @tenderlove: If corpora...
|
2627
|
+
244104558433951744 Sep 7 08:07 @al3x RT @wcmaier: Better bankin...
|
2628
|
+
244107236262170624 Sep 7 08:17 @fbjork RT @jondot: Just published...
|
2629
|
+
244107823733174272 Sep 7 08:20 @codeforamerica RT @randomhacks: Going to ...
|
2630
|
+
244108728834592770 Sep 7 08:23 @calebelston RT @olivercameron: Mosaic ...
|
2631
|
+
244102729860009984 Sep 7 08:00 @dhh RT @ggreenwald: Democrats ...
|
2632
|
+
244102834398851073 Sep 7 08:00 @JEG2 RT @tenderlove: If corpora...
|
2633
|
+
244104558433951744 Sep 7 08:07 @al3x RT @wcmaier: Better bankin...
|
2634
|
+
244107236262170624 Sep 7 08:17 @fbjork RT @jondot: Just published...
|
2635
|
+
244107823733174272 Sep 7 08:20 @codeforamerica RT @randomhacks: Going to ...
|
2636
|
+
244108728834592770 Sep 7 08:23 @calebelston RT @olivercameron: Mosaic ...
|
2629
2637
|
eos
|
2630
2638
|
end
|
2631
2639
|
end
|
2632
2640
|
end
|
2633
2641
|
context "--number" do
|
2634
2642
|
before do
|
2635
|
-
stub_get("/1/statuses/
|
2636
|
-
with(:query => {:count => "
|
2637
|
-
to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
2638
|
-
stub_get("/1/statuses/retweeted_by_me.json").
|
2639
|
-
with(:query => {:count => "200"}).
|
2643
|
+
stub_get("/1.1/statuses/user_timeline.json").
|
2644
|
+
with(:query => {:count => "200", :include_rts => "true"}).
|
2640
2645
|
to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
2641
|
-
stub_get("/1/statuses/
|
2642
|
-
with(:query => {:count => "200", :max_id => "
|
2646
|
+
stub_get("/1.1/statuses/user_timeline.json").
|
2647
|
+
with(:query => {:count => "200", :include_rts => "true", :max_id => "244107823733174271"}).
|
2643
2648
|
to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
2644
|
-
(5..185).step(20).to_a.reverse.each do |count|
|
2645
|
-
stub_get("/1/statuses/retweeted_by_me.json").
|
2646
|
-
with(:query => {:count => count, :max_id => "194546264212385792"}).
|
2647
|
-
to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
2648
|
-
end
|
2649
2649
|
end
|
2650
2650
|
it "should limit the number of results to 1" do
|
2651
2651
|
@cli.options = @cli.options.merge("number" => 1)
|
2652
2652
|
@cli.retweets
|
2653
|
-
a_get("/1/statuses/
|
2654
|
-
with(:query => {:count => "
|
2653
|
+
a_get("/1.1/statuses/user_timeline.json").
|
2654
|
+
with(:query => {:count => "200", :include_rts => "true"}).
|
2655
2655
|
should have_been_made
|
2656
2656
|
end
|
2657
2657
|
it "should limit the number of results to 345" do
|
2658
2658
|
@cli.options = @cli.options.merge("number" => 345)
|
2659
2659
|
@cli.retweets
|
2660
|
-
a_get("/1/statuses/
|
2661
|
-
with(:query => {:count => "200"}).
|
2660
|
+
a_get("/1.1/statuses/user_timeline.json").
|
2661
|
+
with(:query => {:count => "200", :include_rts => "true"}).
|
2662
|
+
should have_been_made
|
2663
|
+
a_get("/1.1/statuses/user_timeline.json").
|
2664
|
+
with(:query => {:count => "200", :include_rts => "true", :max_id => "244107823733174271"}).
|
2662
2665
|
should have_been_made
|
2663
|
-
a_get("/1/statuses/retweeted_by_me.json").
|
2664
|
-
with(:query => {:count => "200", :max_id => "194546264212385792"}).
|
2665
|
-
should have_been_made.times(7)
|
2666
|
-
(5..185).step(20).to_a.reverse.each do |count|
|
2667
|
-
a_get("/1/statuses/retweeted_by_me.json").
|
2668
|
-
with(:query => {:count => count, :max_id => "194546264212385792"}).
|
2669
|
-
should have_been_made
|
2670
|
-
end
|
2671
2666
|
end
|
2672
2667
|
end
|
2673
2668
|
context "with a user passed" do
|
2674
2669
|
before do
|
2675
|
-
stub_get("/1/statuses/
|
2676
|
-
with(:query => {:count => "
|
2670
|
+
stub_get("/1.1/statuses/user_timeline.json").
|
2671
|
+
with(:query => {:count => "200", :include_rts => "true", :screen_name => "sferik"}).
|
2672
|
+
to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
2673
|
+
stub_get("/1.1/statuses/user_timeline.json").
|
2674
|
+
with(:query => {:count => "200", :include_rts => "true", :screen_name => "sferik", :max_id => "244102729860009983"}).
|
2677
2675
|
to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
2678
2676
|
end
|
2679
2677
|
it "should request the correct resource" do
|
2680
2678
|
@cli.retweets("sferik")
|
2681
|
-
a_get("/1/statuses/
|
2682
|
-
with(:query => {:count => "
|
2679
|
+
a_get("/1.1/statuses/user_timeline.json").
|
2680
|
+
with(:query => {:count => "200", :include_rts => "true", :screen_name => "sferik"}).
|
2683
2681
|
should have_been_made
|
2682
|
+
a_get("/1.1/statuses/user_timeline.json").
|
2683
|
+
with(:query => {:count => "200", :include_rts => "true", :screen_name => "sferik", :max_id => "244102729860009983"}).
|
2684
|
+
should have_been_made.times(3)
|
2684
2685
|
end
|
2685
2686
|
context "--id" do
|
2686
2687
|
before do
|
2687
2688
|
@cli.options = @cli.options.merge("id" => true)
|
2688
|
-
stub_get("/1/statuses/
|
2689
|
-
with(:query => {:count => "
|
2689
|
+
stub_get("/1.1/statuses/user_timeline.json").
|
2690
|
+
with(:query => {:count => "200", :include_rts => "true", :user_id => "7505382"}).
|
2691
|
+
to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
2692
|
+
stub_get("/1.1/statuses/user_timeline.json").
|
2693
|
+
with(:query => {:count => "200", :include_rts => "true", :user_id => "7505382", :max_id => "244102729860009983"}).
|
2690
2694
|
to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
2691
2695
|
end
|
2692
2696
|
it "should request the correct resource" do
|
2693
2697
|
@cli.retweets("7505382")
|
2694
|
-
a_get("/1/statuses/
|
2695
|
-
with(:query => {:count => "
|
2698
|
+
a_get("/1.1/statuses/user_timeline.json").
|
2699
|
+
with(:query => {:count => "200", :include_rts => "true", :user_id => "7505382"}).
|
2696
2700
|
should have_been_made
|
2701
|
+
a_get("/1.1/statuses/user_timeline.json").
|
2702
|
+
with(:query => {:count => "200", :include_rts => "true", :user_id => "7505382", :max_id => "244102729860009983"}).
|
2703
|
+
should have_been_made.times(3)
|
2697
2704
|
end
|
2698
2705
|
end
|
2699
2706
|
end
|
@@ -2719,13 +2726,13 @@ ID Posted at Screen name Text
|
|
2719
2726
|
|
2720
2727
|
describe "#status" do
|
2721
2728
|
before do
|
2722
|
-
stub_get("/1/statuses/show/55709764298092545.json").
|
2729
|
+
stub_get("/1.1/statuses/show/55709764298092545.json").
|
2723
2730
|
with(:query => {:include_my_retweet => "false"}).
|
2724
2731
|
to_return(:body => fixture("status.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
2725
2732
|
end
|
2726
2733
|
it "should request the correct resource" do
|
2727
2734
|
@cli.status("55709764298092545")
|
2728
|
-
a_get("/1/statuses/show/55709764298092545.json").
|
2735
|
+
a_get("/1.1/statuses/show/55709764298092545.json").
|
2729
2736
|
with(:query => {:include_my_retweet => "false"}).
|
2730
2737
|
should have_been_made
|
2731
2738
|
end
|
@@ -2756,7 +2763,7 @@ ID,Text,Screen name,Posted at,Location,Retweets,Source,URL
|
|
2756
2763
|
end
|
2757
2764
|
context "with no street address" do
|
2758
2765
|
before do
|
2759
|
-
stub_get("/1/statuses/show/55709764298092550.json").
|
2766
|
+
stub_get("/1.1/statuses/show/55709764298092550.json").
|
2760
2767
|
with(:query => {:include_my_retweet => "false"}).
|
2761
2768
|
to_return(:body => fixture("status_no_street_address.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
2762
2769
|
end
|
@@ -2776,7 +2783,7 @@ URL https://twitter.com/sferik/status/55709764298092550
|
|
2776
2783
|
end
|
2777
2784
|
context "with no locality" do
|
2778
2785
|
before do
|
2779
|
-
stub_get("/1/statuses/show/55709764298092549.json").
|
2786
|
+
stub_get("/1.1/statuses/show/55709764298092549.json").
|
2780
2787
|
with(:query => {:include_my_retweet => "false"}).
|
2781
2788
|
to_return(:body => fixture("status_no_locality.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
2782
2789
|
end
|
@@ -2796,7 +2803,7 @@ URL https://twitter.com/sferik/status/55709764298092549
|
|
2796
2803
|
end
|
2797
2804
|
context "with no attributes" do
|
2798
2805
|
before do
|
2799
|
-
stub_get("/1/statuses/show/55709764298092546.json").
|
2806
|
+
stub_get("/1.1/statuses/show/55709764298092546.json").
|
2800
2807
|
with(:query => {:include_my_retweet => "false"}).
|
2801
2808
|
to_return(:body => fixture("status_no_attributes.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
2802
2809
|
end
|
@@ -2816,7 +2823,7 @@ URL https://twitter.com/sferik/status/55709764298092546
|
|
2816
2823
|
end
|
2817
2824
|
context "with no country" do
|
2818
2825
|
before do
|
2819
|
-
stub_get("/1/statuses/show/55709764298092547.json").
|
2826
|
+
stub_get("/1.1/statuses/show/55709764298092547.json").
|
2820
2827
|
with(:query => {:include_my_retweet => "false"}).
|
2821
2828
|
to_return(:body => fixture("status_no_country.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
2822
2829
|
end
|
@@ -2836,7 +2843,7 @@ URL https://twitter.com/sferik/status/55709764298092547
|
|
2836
2843
|
end
|
2837
2844
|
context "with no full name" do
|
2838
2845
|
before do
|
2839
|
-
stub_get("/1/statuses/show/55709764298092548.json").
|
2846
|
+
stub_get("/1.1/statuses/show/55709764298092548.json").
|
2840
2847
|
with(:query => {:include_my_retweet => "false"}).
|
2841
2848
|
to_return(:body => fixture("status_no_full_name.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
2842
2849
|
end
|
@@ -2856,264 +2863,96 @@ URL https://twitter.com/sferik/status/55709764298092548
|
|
2856
2863
|
end
|
2857
2864
|
end
|
2858
2865
|
|
2859
|
-
describe "#suggest" do
|
2860
|
-
before do
|
2861
|
-
stub_get("/1/account/verify_credentials.json").
|
2862
|
-
to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
2863
|
-
stub_get("/1/users/recommendations.json").
|
2864
|
-
with(:query => {:limit => "20", :screen_name => "sferik"}).
|
2865
|
-
to_return(:body => fixture("recommendations.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
2866
|
-
end
|
2867
|
-
it "should request the correct resource" do
|
2868
|
-
@cli.suggest
|
2869
|
-
stub_get("/1/account/verify_credentials.json").
|
2870
|
-
should have_been_made
|
2871
|
-
a_get("/1/users/recommendations.json").
|
2872
|
-
with(:query => {:limit => "20", :screen_name => "sferik"}).
|
2873
|
-
should have_been_made
|
2874
|
-
end
|
2875
|
-
it "should have the correct output" do
|
2876
|
-
@cli.suggest
|
2877
|
-
$stdout.string.chomp.should == "antpires jtrupiano maccman mlroach stuntmann82"
|
2878
|
-
end
|
2879
|
-
context "--csv" do
|
2880
|
-
before do
|
2881
|
-
@cli.options = @cli.options.merge("csv" => true)
|
2882
|
-
end
|
2883
|
-
it "should output in CSV format" do
|
2884
|
-
@cli.suggest
|
2885
|
-
$stdout.string.should == <<-eos
|
2886
|
-
ID,Since,Last tweeted at,Tweets,Favorites,Listed,Following,Followers,Screen name,Name
|
2887
|
-
40514587,2009-05-16 18:24:33 +0000,2011-06-13 16:27:31 +0000,183,2,2,198,158,antpires,AntonioPires
|
2888
|
-
14736332,2008-05-11 19:46:06 +0000,2011-08-20 03:27:22 +0000,3850,117,99,545,802,jtrupiano,John Trupiano
|
2889
|
-
2006261,2007-03-23 12:36:14 +0000,2011-08-21 23:54:01 +0000,4497,9,171,967,2028,maccman,Alex MacCaw
|
2890
|
-
14451152,2008-04-20 12:05:38 +0000,2011-08-21 20:59:41 +0000,6251,10,20,403,299,mlroach,Matt Laroche
|
2891
|
-
16052754,2008-08-30 08:22:57 +0000,2009-11-25 06:20:05 +0000,24,0,1,5,42,stuntmann82,stuntmann82
|
2892
|
-
eos
|
2893
|
-
end
|
2894
|
-
end
|
2895
|
-
context "--long" do
|
2896
|
-
before do
|
2897
|
-
@cli.options = @cli.options.merge("long" => true)
|
2898
|
-
end
|
2899
|
-
it "should output in long format" do
|
2900
|
-
@cli.suggest
|
2901
|
-
$stdout.string.should == <<-eos
|
2902
|
-
ID Since Last tweeted at Tweets Favorites Listed Following...
|
2903
|
-
40514587 May 16 2009 Jun 13 08:27 183 2 2 198...
|
2904
|
-
14736332 May 11 2008 Aug 19 19:27 3850 117 99 545...
|
2905
|
-
2006261 Mar 23 2007 Aug 21 15:54 4497 9 171 967...
|
2906
|
-
14451152 Apr 20 2008 Aug 21 12:59 6251 10 20 403...
|
2907
|
-
16052754 Aug 30 2008 Nov 24 2009 24 0 1 5...
|
2908
|
-
eos
|
2909
|
-
end
|
2910
|
-
end
|
2911
|
-
context "--number" do
|
2912
|
-
before do
|
2913
|
-
@cli.options = @cli.options.merge("number" => 1)
|
2914
|
-
stub_get("/1/users/recommendations.json").
|
2915
|
-
with(:query => {:limit => "1", :screen_name => "sferik"}).
|
2916
|
-
to_return(:body => fixture("recommendations.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
2917
|
-
end
|
2918
|
-
it "should limit the number of results" do
|
2919
|
-
@cli.suggest
|
2920
|
-
a_get("/1/users/recommendations.json").
|
2921
|
-
with(:query => {:limit => "1", :screen_name => "sferik"}).
|
2922
|
-
should have_been_made
|
2923
|
-
end
|
2924
|
-
end
|
2925
|
-
context "--reverse" do
|
2926
|
-
before do
|
2927
|
-
@cli.options = @cli.options.merge("reverse" => true)
|
2928
|
-
end
|
2929
|
-
it "should reverse the order of the sort" do
|
2930
|
-
@cli.suggest
|
2931
|
-
$stdout.string.chomp.should == "stuntmann82 mlroach maccman jtrupiano antpires"
|
2932
|
-
end
|
2933
|
-
end
|
2934
|
-
context "--sort=favorites" do
|
2935
|
-
before do
|
2936
|
-
@cli.options = @cli.options.merge("sort" => "favorites")
|
2937
|
-
end
|
2938
|
-
it "should sort by number of favorites" do
|
2939
|
-
@cli.suggest
|
2940
|
-
$stdout.string.chomp.should == "stuntmann82 antpires maccman mlroach jtrupiano"
|
2941
|
-
end
|
2942
|
-
end
|
2943
|
-
context "--sort=followers" do
|
2944
|
-
before do
|
2945
|
-
@cli.options = @cli.options.merge("sort" => "followers")
|
2946
|
-
end
|
2947
|
-
it "should sort by number of followers" do
|
2948
|
-
@cli.suggest
|
2949
|
-
$stdout.string.chomp.should == "stuntmann82 antpires mlroach jtrupiano maccman"
|
2950
|
-
end
|
2951
|
-
end
|
2952
|
-
context "--sort=friends" do
|
2953
|
-
before do
|
2954
|
-
@cli.options = @cli.options.merge("sort" => "friends")
|
2955
|
-
end
|
2956
|
-
it "should sort by number of friends" do
|
2957
|
-
@cli.suggest
|
2958
|
-
$stdout.string.chomp.should == "stuntmann82 antpires mlroach jtrupiano maccman"
|
2959
|
-
end
|
2960
|
-
end
|
2961
|
-
context "--sort=listed" do
|
2962
|
-
before do
|
2963
|
-
@cli.options = @cli.options.merge("sort" => "listed")
|
2964
|
-
end
|
2965
|
-
it "should sort by number of list memberships" do
|
2966
|
-
@cli.suggest
|
2967
|
-
$stdout.string.chomp.should == "stuntmann82 antpires mlroach jtrupiano maccman"
|
2968
|
-
end
|
2969
|
-
end
|
2970
|
-
context "--sort=since" do
|
2971
|
-
before do
|
2972
|
-
@cli.options = @cli.options.merge("sort" => "since")
|
2973
|
-
end
|
2974
|
-
it "should sort by the time when Twitter acount was created" do
|
2975
|
-
@cli.suggest
|
2976
|
-
$stdout.string.chomp.should == "maccman mlroach jtrupiano stuntmann82 antpires"
|
2977
|
-
end
|
2978
|
-
end
|
2979
|
-
context "--sort=tweets" do
|
2980
|
-
before do
|
2981
|
-
@cli.options = @cli.options.merge("sort" => "tweets")
|
2982
|
-
end
|
2983
|
-
it "should sort by number of Tweets" do
|
2984
|
-
@cli.suggest
|
2985
|
-
$stdout.string.chomp.should == "stuntmann82 antpires jtrupiano maccman mlroach"
|
2986
|
-
end
|
2987
|
-
end
|
2988
|
-
context "--sort=tweeted" do
|
2989
|
-
before do
|
2990
|
-
@cli.options = @cli.options.merge("sort" => "tweeted")
|
2991
|
-
end
|
2992
|
-
it "should sort by the time of the last Tweet" do
|
2993
|
-
@cli.suggest
|
2994
|
-
$stdout.string.chomp.should == "stuntmann82 antpires jtrupiano mlroach maccman"
|
2995
|
-
end
|
2996
|
-
end
|
2997
|
-
context "--unsorted" do
|
2998
|
-
before do
|
2999
|
-
@cli.options = @cli.options.merge("unsorted" => true)
|
3000
|
-
end
|
3001
|
-
it "should not be sorted" do
|
3002
|
-
@cli.suggest
|
3003
|
-
$stdout.string.chomp.should == "jtrupiano mlroach antpires maccman stuntmann82"
|
3004
|
-
end
|
3005
|
-
end
|
3006
|
-
context "with a user passed" do
|
3007
|
-
it "should request the correct resource" do
|
3008
|
-
@cli.suggest("sferik")
|
3009
|
-
a_get("/1/users/recommendations.json").
|
3010
|
-
with(:query => {:limit => "20", :screen_name => "sferik"}).
|
3011
|
-
should have_been_made
|
3012
|
-
end
|
3013
|
-
it "should have the correct output" do
|
3014
|
-
@cli.suggest("sferik")
|
3015
|
-
$stdout.string.chomp.should == "antpires jtrupiano maccman mlroach stuntmann82"
|
3016
|
-
end
|
3017
|
-
context "--id" do
|
3018
|
-
before do
|
3019
|
-
@cli.options = @cli.options.merge("id" => true)
|
3020
|
-
stub_get("/1/users/recommendations.json").
|
3021
|
-
with(:query => {:limit => "20", :user_id => "7505382"}).
|
3022
|
-
to_return(:body => fixture("recommendations.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
3023
|
-
end
|
3024
|
-
it "should request the correct resource" do
|
3025
|
-
@cli.suggest("7505382")
|
3026
|
-
a_get("/1/users/recommendations.json").
|
3027
|
-
with(:query => {:limit => "20", :user_id => "7505382"}).
|
3028
|
-
should have_been_made
|
3029
|
-
end
|
3030
|
-
end
|
3031
|
-
end
|
3032
|
-
end
|
3033
|
-
|
3034
2866
|
describe "#timeline" do
|
3035
2867
|
before do
|
3036
|
-
stub_get("/1/statuses/home_timeline.json").
|
2868
|
+
stub_get("/1.1/statuses/home_timeline.json").
|
3037
2869
|
with(:query => {:count => "20"}).
|
3038
2870
|
to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
3039
2871
|
end
|
3040
2872
|
context "without user" do
|
3041
2873
|
it "should request the correct resource" do
|
3042
2874
|
@cli.timeline
|
3043
|
-
a_get("/1/statuses/home_timeline.json").
|
2875
|
+
a_get("/1.1/statuses/home_timeline.json").
|
3044
2876
|
with(:query => {:count => "20"}).
|
3045
2877
|
should have_been_made
|
3046
2878
|
end
|
3047
2879
|
it "should have the correct output" do
|
3048
2880
|
@cli.timeline
|
3049
2881
|
$stdout.string.should == <<-eos
|
3050
|
-
\e[1m\e[33m @
|
3051
|
-
|
3052
|
-
CI, the element Oxygen.
|
2882
|
+
\e[1m\e[33m @mutgoff\e[0m
|
2883
|
+
Happy Birthday @imdane. Watch out for those @rally pranksters!
|
3053
2884
|
|
3054
|
-
\e[1m\e[33m @
|
3055
|
-
|
3056
|
-
|
2885
|
+
\e[1m\e[33m @ironicsans\e[0m
|
2886
|
+
If you like good real-life stories, check out @NarrativelyNY's just-launched
|
2887
|
+
site http://t.co/wiUL07jE (and also visit http://t.co/ZoyQxqWA)
|
3057
2888
|
|
3058
|
-
\e[1m\e[33m @
|
3059
|
-
|
3060
|
-
|
2889
|
+
\e[1m\e[33m @pat_shaughnessy\e[0m
|
2890
|
+
Something else to vote for: "New Rails workshops to bring more women into the
|
2891
|
+
Boston software scene" http://t.co/eNBuckHc /cc @bostonrb
|
3061
2892
|
|
3062
|
-
\e[1m\e[33m @
|
3063
|
-
|
3064
|
-
mystery. Today is a gift. That's why it's called the present.
|
2893
|
+
\e[1m\e[33m @calebelston\e[0m
|
2894
|
+
Pushing the button to launch the site. http://t.co/qLoEn5jG
|
3065
2895
|
|
3066
|
-
\e[1m\e[33m @
|
3067
|
-
@
|
2896
|
+
\e[1m\e[33m @calebelston\e[0m
|
2897
|
+
RT @olivercameron: Mosaic looks cool: http://t.co/A8013C9k
|
3068
2898
|
|
3069
|
-
\e[1m\e[33m @
|
3070
|
-
|
2899
|
+
\e[1m\e[33m @fivethirtyeight\e[0m
|
2900
|
+
The Weatherman is Not a Moron: http://t.co/ZwL5Gnq5. An excerpt from my book,
|
2901
|
+
THE SIGNAL AND THE NOISE (http://t.co/fNXj8vCE)
|
3071
2902
|
|
3072
|
-
\e[1m\e[33m @
|
3073
|
-
|
2903
|
+
\e[1m\e[33m @codeforamerica\e[0m
|
2904
|
+
RT @randomhacks: Going to Code Across Austin II: Y'all Come Hack Now, Sat,
|
2905
|
+
Sep 8 http://t.co/Sk5BM7U3 We'll see y'all there! #rhok @codeforamerica
|
2906
|
+
@TheaClay
|
3074
2907
|
|
3075
|
-
\e[1m\e[33m @
|
3076
|
-
|
2908
|
+
\e[1m\e[33m @fbjork\e[0m
|
2909
|
+
RT @jondot: Just published: "Pragmatic Concurrency With #Ruby"
|
2910
|
+
http://t.co/kGEykswZ /cc @JRuby @headius
|
3077
2911
|
|
3078
|
-
\e[1m\e[33m @
|
3079
|
-
|
2912
|
+
\e[1m\e[33m @mbostock\e[0m
|
2913
|
+
If you are wondering how we computed the split bubbles: http://t.co/BcaqSs5u
|
3080
2914
|
|
3081
|
-
\e[1m\e[33m @
|
3082
|
-
|
3083
|
-
a clever German. http://t.co/JvLNQCDm @skilldrick @hoverbird
|
2915
|
+
\e[1m\e[33m @FakeDorsey\e[0m
|
2916
|
+
“Write drunk. Edit sober.”—Ernest Hemingway
|
3084
2917
|
|
3085
|
-
\e[1m\e[33m @
|
3086
|
-
|
2918
|
+
\e[1m\e[33m @al3x\e[0m
|
2919
|
+
RT @wcmaier: Better banking through better ops: build something new with us
|
2920
|
+
@Simplify (remote, PDX) http://t.co/8WgzKZH3
|
3087
2921
|
|
3088
|
-
\e[1m\e[33m @
|
3089
|
-
|
2922
|
+
\e[1m\e[33m @calebelston\e[0m
|
2923
|
+
We just announced Mosaic, what we've been working on since the Yobongo
|
2924
|
+
acquisition. My personal post, http://t.co/ELOyIRZU @heymosaic
|
3090
2925
|
|
3091
|
-
\e[1m\e[33m @
|
3092
|
-
|
2926
|
+
\e[1m\e[33m @BarackObama\e[0m
|
2927
|
+
Donate $10 or more --> get your favorite car magnet: http://t.co/NfRhl2s2
|
2928
|
+
#Obama2012
|
3093
2929
|
|
3094
|
-
\e[1m\e[33m @
|
3095
|
-
|
2930
|
+
\e[1m\e[33m @JEG2\e[0m
|
2931
|
+
RT @tenderlove: If corporations are people, can we use them to drive in the
|
2932
|
+
carpool lane?
|
3096
2933
|
|
3097
|
-
\e[1m\e[33m @
|
3098
|
-
|
2934
|
+
\e[1m\e[33m @eveningedition\e[0m
|
2935
|
+
LDN—Obama's nomination; Putin woos APEC; Bombs hit Damascus; Quakes shake
|
2936
|
+
China; Canada cuts Iran ties; weekend read: http://t.co/OFs6dVW4
|
3099
2937
|
|
3100
|
-
\e[1m\e[33m @
|
3101
|
-
|
3102
|
-
|
2938
|
+
\e[1m\e[33m @dhh\e[0m
|
2939
|
+
RT @ggreenwald: Democrats parade Osama bin Laden's corpse as their proudest
|
2940
|
+
achievement: why this goulish jingoism is so warped http://t.co/kood278s
|
3103
2941
|
|
3104
|
-
\e[1m\e[33m @
|
3105
|
-
|
3106
|
-
|
2942
|
+
\e[1m\e[33m @jasonfried\e[0m
|
2943
|
+
The story of Mars Curiosity's gears, made by a factory in Rockford, IL:
|
2944
|
+
http://t.co/MwCRsHQg
|
3107
2945
|
|
3108
|
-
\e[1m\e[33m @
|
3109
|
-
@
|
2946
|
+
\e[1m\e[33m @sferik\e[0m
|
2947
|
+
@episod @twitterapi now https://t.co/I17jUTu2 and https://t.co/deDu4Hgw seem
|
2948
|
+
to be missing "1.1" from the URL.
|
3110
2949
|
|
3111
|
-
\e[1m\e[33m @
|
3112
|
-
@
|
2950
|
+
\e[1m\e[33m @sferik\e[0m
|
2951
|
+
@episod @twitterapi Did you catch https://t.co/VHsQvZT0 as well?
|
3113
2952
|
|
3114
|
-
\e[1m\e[33m @
|
3115
|
-
|
3116
|
-
|
2953
|
+
\e[1m\e[33m @dwiskus\e[0m
|
2954
|
+
Gentlemen, you can't fight in here! This is the war room!
|
2955
|
+
http://t.co/kMxMYyqF
|
3117
2956
|
|
3118
2957
|
eos
|
3119
2958
|
end
|
@@ -3126,26 +2965,26 @@ ID Since Last tweeted at Tweets Favorites Listed Following...
|
|
3126
2965
|
@cli.timeline
|
3127
2966
|
$stdout.string.should == <<-eos
|
3128
2967
|
ID,Posted at,Screen name,Text
|
3129
|
-
|
3130
|
-
|
3131
|
-
|
3132
|
-
|
3133
|
-
|
3134
|
-
|
3135
|
-
|
3136
|
-
|
3137
|
-
|
3138
|
-
|
3139
|
-
|
3140
|
-
|
3141
|
-
|
3142
|
-
|
3143
|
-
|
3144
|
-
|
3145
|
-
|
3146
|
-
|
3147
|
-
|
3148
|
-
|
2968
|
+
244111636544225280,2012-09-07 16:35:24 +0000,mutgoff,Happy Birthday @imdane. Watch out for those @rally pranksters!
|
2969
|
+
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)"
|
2970
|
+
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"
|
2971
|
+
244109797308379136,2012-09-07 16:28:05 +0000,calebelston,Pushing the button to launch the site. http://t.co/qLoEn5jG
|
2972
|
+
244108728834592770,2012-09-07 16:23:50 +0000,calebelston,RT @olivercameron: Mosaic looks cool: http://t.co/A8013C9k
|
2973
|
+
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)"
|
2974
|
+
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"
|
2975
|
+
244107236262170624,2012-09-07 16:17:55 +0000,fbjork,"RT @jondot: Just published: ""Pragmatic Concurrency With #Ruby"" http://t.co/kGEykswZ /cc @JRuby @headius"
|
2976
|
+
244106476048764928,2012-09-07 16:14:53 +0000,mbostock,If you are wondering how we computed the split bubbles: http://t.co/BcaqSs5u
|
2977
|
+
244105599351148544,2012-09-07 16:11:24 +0000,FakeDorsey,“Write drunk. Edit sober.”—Ernest Hemingway
|
2978
|
+
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"
|
2979
|
+
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"
|
2980
|
+
244103057175113729,2012-09-07 16:01:18 +0000,BarackObama,Donate $10 or more --> get your favorite car magnet: http://t.co/NfRhl2s2 #Obama2012
|
2981
|
+
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?"
|
2982
|
+
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
|
2983
|
+
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
|
2984
|
+
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"
|
2985
|
+
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."
|
2986
|
+
244100411563339777,2012-09-07 15:50:47 +0000,sferik,@episod @twitterapi Did you catch https://t.co/VHsQvZT0 as well?
|
2987
|
+
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"
|
3149
2988
|
eos
|
3150
2989
|
end
|
3151
2990
|
end
|
@@ -3156,27 +2995,27 @@ ID,Posted at,Screen name,Text
|
|
3156
2995
|
it "should output in long format" do
|
3157
2996
|
@cli.timeline
|
3158
2997
|
$stdout.string.should == <<-eos
|
3159
|
-
ID Posted at Screen name
|
3160
|
-
|
3161
|
-
|
3162
|
-
|
3163
|
-
|
3164
|
-
|
3165
|
-
|
3166
|
-
|
3167
|
-
|
3168
|
-
|
3169
|
-
|
3170
|
-
|
3171
|
-
|
3172
|
-
|
3173
|
-
|
3174
|
-
|
3175
|
-
|
3176
|
-
|
3177
|
-
|
3178
|
-
|
3179
|
-
|
2998
|
+
ID Posted at Screen name Text
|
2999
|
+
244111636544225280 Sep 7 08:35 @mutgoff Happy Birthday @imdane. W...
|
3000
|
+
244111183165157376 Sep 7 08:33 @ironicsans If you like good real-lif...
|
3001
|
+
244110336414859264 Sep 7 08:30 @pat_shaughnessy Something else to vote fo...
|
3002
|
+
244109797308379136 Sep 7 08:28 @calebelston Pushing the button to lau...
|
3003
|
+
244108728834592770 Sep 7 08:23 @calebelston RT @olivercameron: Mosaic...
|
3004
|
+
244107890632294400 Sep 7 08:20 @fivethirtyeight The Weatherman is Not a M...
|
3005
|
+
244107823733174272 Sep 7 08:20 @codeforamerica RT @randomhacks: Going to...
|
3006
|
+
244107236262170624 Sep 7 08:17 @fbjork RT @jondot: Just publishe...
|
3007
|
+
244106476048764928 Sep 7 08:14 @mbostock If you are wondering how ...
|
3008
|
+
244105599351148544 Sep 7 08:11 @FakeDorsey “Write drunk. Edit sober....
|
3009
|
+
244104558433951744 Sep 7 08:07 @al3x RT @wcmaier: Better banki...
|
3010
|
+
244104146997870594 Sep 7 08:05 @calebelston We just announced Mosaic,...
|
3011
|
+
244103057175113729 Sep 7 08:01 @BarackObama Donate $10 or more --> ge...
|
3012
|
+
244102834398851073 Sep 7 08:00 @JEG2 RT @tenderlove: If corpor...
|
3013
|
+
244102741125890048 Sep 7 08:00 @eveningedition LDN—Obama's nomination; P...
|
3014
|
+
244102729860009984 Sep 7 08:00 @dhh RT @ggreenwald: Democrats...
|
3015
|
+
244102490646278146 Sep 7 07:59 @jasonfried The story of Mars Curiosi...
|
3016
|
+
244102209942458368 Sep 7 07:57 @sferik @episod @twitterapi now h...
|
3017
|
+
244100411563339777 Sep 7 07:50 @sferik @episod @twitterapi Did y...
|
3018
|
+
244099460672679938 Sep 7 07:47 @dwiskus Gentlemen, you can't figh...
|
3180
3019
|
eos
|
3181
3020
|
end
|
3182
3021
|
context "--reverse" do
|
@@ -3186,133 +3025,133 @@ ID Posted at Screen name Text
|
|
3186
3025
|
it "should reverse the order of the sort" do
|
3187
3026
|
@cli.timeline
|
3188
3027
|
$stdout.string.should == <<-eos
|
3189
|
-
ID Posted at Screen name
|
3190
|
-
|
3191
|
-
|
3192
|
-
|
3193
|
-
|
3194
|
-
|
3195
|
-
|
3196
|
-
|
3197
|
-
|
3198
|
-
|
3199
|
-
|
3200
|
-
|
3201
|
-
|
3202
|
-
|
3203
|
-
|
3204
|
-
|
3205
|
-
|
3206
|
-
|
3207
|
-
|
3208
|
-
|
3209
|
-
|
3028
|
+
ID Posted at Screen name Text
|
3029
|
+
244099460672679938 Sep 7 07:47 @dwiskus Gentlemen, you can't figh...
|
3030
|
+
244100411563339777 Sep 7 07:50 @sferik @episod @twitterapi Did y...
|
3031
|
+
244102209942458368 Sep 7 07:57 @sferik @episod @twitterapi now h...
|
3032
|
+
244102490646278146 Sep 7 07:59 @jasonfried The story of Mars Curiosi...
|
3033
|
+
244102729860009984 Sep 7 08:00 @dhh RT @ggreenwald: Democrats...
|
3034
|
+
244102741125890048 Sep 7 08:00 @eveningedition LDN—Obama's nomination; P...
|
3035
|
+
244102834398851073 Sep 7 08:00 @JEG2 RT @tenderlove: If corpor...
|
3036
|
+
244103057175113729 Sep 7 08:01 @BarackObama Donate $10 or more --> ge...
|
3037
|
+
244104146997870594 Sep 7 08:05 @calebelston We just announced Mosaic,...
|
3038
|
+
244104558433951744 Sep 7 08:07 @al3x RT @wcmaier: Better banki...
|
3039
|
+
244105599351148544 Sep 7 08:11 @FakeDorsey “Write drunk. Edit sober....
|
3040
|
+
244106476048764928 Sep 7 08:14 @mbostock If you are wondering how ...
|
3041
|
+
244107236262170624 Sep 7 08:17 @fbjork RT @jondot: Just publishe...
|
3042
|
+
244107823733174272 Sep 7 08:20 @codeforamerica RT @randomhacks: Going to...
|
3043
|
+
244107890632294400 Sep 7 08:20 @fivethirtyeight The Weatherman is Not a M...
|
3044
|
+
244108728834592770 Sep 7 08:23 @calebelston RT @olivercameron: Mosaic...
|
3045
|
+
244109797308379136 Sep 7 08:28 @calebelston Pushing the button to lau...
|
3046
|
+
244110336414859264 Sep 7 08:30 @pat_shaughnessy Something else to vote fo...
|
3047
|
+
244111183165157376 Sep 7 08:33 @ironicsans If you like good real-lif...
|
3048
|
+
244111636544225280 Sep 7 08:35 @mutgoff Happy Birthday @imdane. W...
|
3210
3049
|
eos
|
3211
3050
|
end
|
3212
3051
|
end
|
3213
3052
|
end
|
3214
3053
|
context "--number" do
|
3215
3054
|
before do
|
3216
|
-
stub_get("/1/statuses/home_timeline.json").
|
3055
|
+
stub_get("/1.1/statuses/home_timeline.json").
|
3217
3056
|
with(:query => {:count => "1"}).
|
3218
3057
|
to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
3219
|
-
stub_get("/1/statuses/home_timeline.json").
|
3058
|
+
stub_get("/1.1/statuses/home_timeline.json").
|
3220
3059
|
with(:query => {:count => "200"}).
|
3221
3060
|
to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
3222
|
-
stub_get("/1/statuses/home_timeline.json").
|
3223
|
-
with(:query => {:count => "200", :max_id => "
|
3061
|
+
stub_get("/1.1/statuses/home_timeline.json").
|
3062
|
+
with(:query => {:count => "200", :max_id => "244099460672679937"}).
|
3224
3063
|
to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
3225
3064
|
(5..185).step(20).to_a.reverse.each do |count|
|
3226
|
-
stub_get("/1/statuses/home_timeline.json").
|
3227
|
-
with(:query => {:count => count, :max_id => "
|
3065
|
+
stub_get("/1.1/statuses/home_timeline.json").
|
3066
|
+
with(:query => {:count => count, :max_id => "244099460672679937"}).
|
3228
3067
|
to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
3229
3068
|
end
|
3230
3069
|
end
|
3231
3070
|
it "should limit the number of results to 1" do
|
3232
3071
|
@cli.options = @cli.options.merge("number" => 1)
|
3233
3072
|
@cli.timeline
|
3234
|
-
a_get("/1/statuses/home_timeline.json").
|
3073
|
+
a_get("/1.1/statuses/home_timeline.json").
|
3235
3074
|
with(:query => {:count => "1"}).
|
3236
3075
|
should have_been_made
|
3237
3076
|
end
|
3238
3077
|
it "should limit the number of results to 345" do
|
3239
3078
|
@cli.options = @cli.options.merge("number" => 345)
|
3240
3079
|
@cli.timeline
|
3241
|
-
a_get("/1/statuses/home_timeline.json").
|
3080
|
+
a_get("/1.1/statuses/home_timeline.json").
|
3242
3081
|
with(:query => {:count => "200"}).
|
3243
3082
|
should have_been_made
|
3244
|
-
a_get("/1/statuses/home_timeline.json").
|
3245
|
-
with(:query => {:count => "200", :max_id => "
|
3083
|
+
a_get("/1.1/statuses/home_timeline.json").
|
3084
|
+
with(:query => {:count => "200", :max_id => "244099460672679937"}).
|
3246
3085
|
should have_been_made.times(7)
|
3247
3086
|
(5..185).step(20).to_a.reverse.each do |count|
|
3248
|
-
a_get("/1/statuses/home_timeline.json").
|
3249
|
-
with(:query => {:count => count, :max_id => "
|
3087
|
+
a_get("/1.1/statuses/home_timeline.json").
|
3088
|
+
with(:query => {:count => count, :max_id => "244099460672679937"}).
|
3250
3089
|
should have_been_made
|
3251
3090
|
end
|
3252
3091
|
end
|
3253
3092
|
end
|
3254
3093
|
context "with a user passed" do
|
3255
3094
|
before do
|
3256
|
-
stub_get("/1/statuses/user_timeline.json").
|
3095
|
+
stub_get("/1.1/statuses/user_timeline.json").
|
3257
3096
|
with(:query => {:count => "20", :screen_name => "sferik"}).
|
3258
3097
|
to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
3259
3098
|
end
|
3260
3099
|
it "should request the correct resource" do
|
3261
3100
|
@cli.timeline("sferik")
|
3262
|
-
a_get("/1/statuses/user_timeline.json").
|
3101
|
+
a_get("/1.1/statuses/user_timeline.json").
|
3263
3102
|
with(:query => {:count => "20", :screen_name => "sferik"}).
|
3264
3103
|
should have_been_made
|
3265
3104
|
end
|
3266
3105
|
context "--id" do
|
3267
3106
|
before do
|
3268
3107
|
@cli.options = @cli.options.merge("id" => true)
|
3269
|
-
stub_get("/1/statuses/user_timeline.json").
|
3108
|
+
stub_get("/1.1/statuses/user_timeline.json").
|
3270
3109
|
with(:query => {:count => "20", :user_id => "7505382"}).
|
3271
3110
|
to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
3272
3111
|
end
|
3273
3112
|
it "should request the correct resource" do
|
3274
3113
|
@cli.timeline("7505382")
|
3275
|
-
a_get("/1/statuses/user_timeline.json").
|
3114
|
+
a_get("/1.1/statuses/user_timeline.json").
|
3276
3115
|
with(:query => {:count => "20", :user_id => "7505382"}).
|
3277
3116
|
should have_been_made
|
3278
3117
|
end
|
3279
3118
|
end
|
3280
3119
|
context "--number" do
|
3281
3120
|
before do
|
3282
|
-
stub_get("/1/statuses/user_timeline.json").
|
3121
|
+
stub_get("/1.1/statuses/user_timeline.json").
|
3283
3122
|
with(:query => {:count => "1", :screen_name => "sferik"}).
|
3284
3123
|
to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
3285
|
-
stub_get("/1/statuses/user_timeline.json").
|
3124
|
+
stub_get("/1.1/statuses/user_timeline.json").
|
3286
3125
|
with(:query => {:count => "200", :screen_name => "sferik"}).
|
3287
3126
|
to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
3288
|
-
stub_get("/1/statuses/user_timeline.json").
|
3289
|
-
with(:query => {:count => "200", :screen_name => "sferik", :max_id => "
|
3127
|
+
stub_get("/1.1/statuses/user_timeline.json").
|
3128
|
+
with(:query => {:count => "200", :screen_name => "sferik", :max_id => "244099460672679937"}).
|
3290
3129
|
to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
3291
3130
|
(5..185).step(20).to_a.reverse.each do |count|
|
3292
|
-
stub_get("/1/statuses/user_timeline.json").
|
3293
|
-
with(:query => {:count => count, :screen_name => "sferik", :max_id => "
|
3131
|
+
stub_get("/1.1/statuses/user_timeline.json").
|
3132
|
+
with(:query => {:count => count, :screen_name => "sferik", :max_id => "244099460672679937"}).
|
3294
3133
|
to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
3295
3134
|
end
|
3296
3135
|
end
|
3297
3136
|
it "should limit the number of results to 1" do
|
3298
3137
|
@cli.options = @cli.options.merge("number" => 1)
|
3299
3138
|
@cli.timeline("sferik")
|
3300
|
-
a_get("/1/statuses/user_timeline.json").
|
3139
|
+
a_get("/1.1/statuses/user_timeline.json").
|
3301
3140
|
with(:query => {:count => "1", :screen_name => "sferik"}).
|
3302
3141
|
should have_been_made
|
3303
3142
|
end
|
3304
3143
|
it "should limit the number of results to 345" do
|
3305
3144
|
@cli.options = @cli.options.merge("number" => 345)
|
3306
3145
|
@cli.timeline("sferik")
|
3307
|
-
a_get("/1/statuses/user_timeline.json").
|
3146
|
+
a_get("/1.1/statuses/user_timeline.json").
|
3308
3147
|
with(:query => {:count => "200", :screen_name => "sferik"}).
|
3309
3148
|
should have_been_made
|
3310
|
-
a_get("/1/statuses/user_timeline.json").
|
3311
|
-
with(:query => {:count => "200", :screen_name => "sferik", :max_id => "
|
3149
|
+
a_get("/1.1/statuses/user_timeline.json").
|
3150
|
+
with(:query => {:count => "200", :screen_name => "sferik", :max_id => "244099460672679937"}).
|
3312
3151
|
should have_been_made.times(7)
|
3313
3152
|
(5..185).step(20).to_a.reverse.each do |count|
|
3314
|
-
a_get("/1/statuses/user_timeline.json").
|
3315
|
-
with(:query => {:count => count, :screen_name => "sferik", :max_id => "
|
3153
|
+
a_get("/1.1/statuses/user_timeline.json").
|
3154
|
+
with(:query => {:count => count, :screen_name => "sferik", :max_id => "244099460672679937"}).
|
3316
3155
|
should have_been_made
|
3317
3156
|
end
|
3318
3157
|
end
|
@@ -3322,12 +3161,14 @@ ID Posted at Screen name Text
|
|
3322
3161
|
|
3323
3162
|
describe "#trends" do
|
3324
3163
|
before do
|
3325
|
-
stub_get("/1/trends/
|
3164
|
+
stub_get("/1.1/trends/place.json").
|
3165
|
+
with(:query => {:id => "1"}).
|
3326
3166
|
to_return(:body => fixture("trends.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
3327
3167
|
end
|
3328
3168
|
it "should request the correct resource" do
|
3329
3169
|
@cli.trends
|
3330
|
-
a_get("/1/trends/
|
3170
|
+
a_get("/1.1/trends/place.json").
|
3171
|
+
with(:query => {:id => "1"}).
|
3331
3172
|
should have_been_made
|
3332
3173
|
end
|
3333
3174
|
it "should have the correct output" do
|
@@ -3337,14 +3178,14 @@ ID Posted at Screen name Text
|
|
3337
3178
|
context "--exclude-hashtags" do
|
3338
3179
|
before do
|
3339
3180
|
@cli.options = @cli.options.merge("exclude-hashtags" => true)
|
3340
|
-
stub_get("/1/trends/
|
3341
|
-
with(:query => {:exclude => "hashtags"}).
|
3181
|
+
stub_get("/1.1/trends/place.json").
|
3182
|
+
with(:query => {:id => "1", :exclude => "hashtags"}).
|
3342
3183
|
to_return(:body => fixture("trends.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
3343
3184
|
end
|
3344
3185
|
it "should request the correct resource" do
|
3345
3186
|
@cli.trends
|
3346
|
-
a_get("/1/trends/
|
3347
|
-
with(:query => {:exclude => "hashtags"}).
|
3187
|
+
a_get("/1.1/trends/place.json").
|
3188
|
+
with(:query => {:id => "1", :exclude => "hashtags"}).
|
3348
3189
|
should have_been_made
|
3349
3190
|
end
|
3350
3191
|
it "should have the correct output" do
|
@@ -3354,12 +3195,14 @@ ID Posted at Screen name Text
|
|
3354
3195
|
end
|
3355
3196
|
context "with a WOEID passed" do
|
3356
3197
|
before do
|
3357
|
-
stub_get("/1/trends/
|
3198
|
+
stub_get("/1.1/trends/place.json").
|
3199
|
+
with(:query => {:id => "2487956"}).
|
3358
3200
|
to_return(:body => fixture("trends.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
3359
3201
|
end
|
3360
3202
|
it "should request the correct resource" do
|
3361
3203
|
@cli.trends("2487956")
|
3362
|
-
a_get("/1/trends/
|
3204
|
+
a_get("/1.1/trends/place.json").
|
3205
|
+
with(:query => {:id => "2487956"}).
|
3363
3206
|
should have_been_made
|
3364
3207
|
end
|
3365
3208
|
it "should have the correct output" do
|
@@ -3371,12 +3214,12 @@ ID Posted at Screen name Text
|
|
3371
3214
|
|
3372
3215
|
describe "#trend_locations" do
|
3373
3216
|
before do
|
3374
|
-
stub_get("/1/trends/available.json").
|
3217
|
+
stub_get("/1.1/trends/available.json").
|
3375
3218
|
to_return(:body => fixture("locations.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
3376
3219
|
end
|
3377
3220
|
it "should request the correct resource" do
|
3378
3221
|
@cli.trend_locations
|
3379
|
-
a_get("/1/trends/available.json").
|
3222
|
+
a_get("/1.1/trends/available.json").
|
3380
3223
|
should have_been_made
|
3381
3224
|
end
|
3382
3225
|
it "should have the correct output" do
|
@@ -3424,6 +3267,42 @@ WOEID Parent ID Type Name Country
|
|
3424
3267
|
$stdout.string.chomp.should == "Worldwide United States San Francisco New York Boston"
|
3425
3268
|
end
|
3426
3269
|
end
|
3270
|
+
context "--sort=country" do
|
3271
|
+
before do
|
3272
|
+
@cli.options = @cli.options.merge("sort" => "country")
|
3273
|
+
end
|
3274
|
+
it "should sort by number of favorites" do
|
3275
|
+
@cli.trend_locations
|
3276
|
+
$stdout.string.chomp.should == "Worldwide New York Boston United States San Francisco"
|
3277
|
+
end
|
3278
|
+
end
|
3279
|
+
context "--sort=parent" do
|
3280
|
+
before do
|
3281
|
+
@cli.options = @cli.options.merge("sort" => "parent")
|
3282
|
+
end
|
3283
|
+
it "should sort by number of favorites" do
|
3284
|
+
@cli.trend_locations
|
3285
|
+
$stdout.string.chomp.should == "Boston Worldwide New York United States San Francisco"
|
3286
|
+
end
|
3287
|
+
end
|
3288
|
+
context "--sort=type" do
|
3289
|
+
before do
|
3290
|
+
@cli.options = @cli.options.merge("sort" => "type")
|
3291
|
+
end
|
3292
|
+
it "should sort by number of favorites" do
|
3293
|
+
@cli.trend_locations
|
3294
|
+
$stdout.string.chomp.should == "United States Worldwide New York Boston San Francisco"
|
3295
|
+
end
|
3296
|
+
end
|
3297
|
+
context "--sort=woeid" do
|
3298
|
+
before do
|
3299
|
+
@cli.options = @cli.options.merge("sort" => "woeid")
|
3300
|
+
end
|
3301
|
+
it "should sort by number of favorites" do
|
3302
|
+
@cli.trend_locations
|
3303
|
+
$stdout.string.chomp.should == "Worldwide Boston New York San Francisco United States"
|
3304
|
+
end
|
3305
|
+
end
|
3427
3306
|
context "--unsorted" do
|
3428
3307
|
before do
|
3429
3308
|
@cli.options = @cli.options.merge("unsorted" => true)
|
@@ -3441,17 +3320,17 @@ WOEID Parent ID Type Name Country
|
|
3441
3320
|
end
|
3442
3321
|
context "one user" do
|
3443
3322
|
it "should request the correct resource" do
|
3444
|
-
|
3445
|
-
with(:
|
3323
|
+
stub_post("/1.1/friendships/destroy.json").
|
3324
|
+
with(:body => {:screen_name => "sferik"}).
|
3446
3325
|
to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
3447
3326
|
@cli.unfollow("sferik")
|
3448
|
-
|
3449
|
-
with(:
|
3327
|
+
a_post("/1.1/friendships/destroy.json").
|
3328
|
+
with(:body => {:screen_name => "sferik"}).
|
3450
3329
|
should have_been_made
|
3451
3330
|
end
|
3452
3331
|
it "should have the correct output" do
|
3453
|
-
|
3454
|
-
with(:
|
3332
|
+
stub_post("/1.1/friendships/destroy.json").
|
3333
|
+
with(:body => {:screen_name => "sferik"}).
|
3455
3334
|
to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
3456
3335
|
@cli.unfollow("sferik")
|
3457
3336
|
$stdout.string.should =~ /^@testcli is no longer following 1 user\.$/
|
@@ -3459,27 +3338,27 @@ WOEID Parent ID Type Name Country
|
|
3459
3338
|
context "--id" do
|
3460
3339
|
before do
|
3461
3340
|
@cli.options = @cli.options.merge("id" => true)
|
3462
|
-
|
3463
|
-
with(:
|
3341
|
+
stub_post("/1.1/friendships/destroy.json").
|
3342
|
+
with(:body => {:user_id => "7505382"}).
|
3464
3343
|
to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
3465
3344
|
end
|
3466
3345
|
it "should request the correct resource" do
|
3467
3346
|
@cli.unfollow("7505382")
|
3468
|
-
|
3469
|
-
with(:
|
3347
|
+
a_post("/1.1/friendships/destroy.json").
|
3348
|
+
with(:body => {:user_id => "7505382"}).
|
3470
3349
|
should have_been_made
|
3471
3350
|
end
|
3472
3351
|
end
|
3473
3352
|
context "Twitter is down" do
|
3474
3353
|
it "should retry 3 times and then raise an error" do
|
3475
|
-
|
3476
|
-
with(:
|
3354
|
+
stub_post("/1.1/friendships/destroy.json").
|
3355
|
+
with(:body => {:screen_name => "sferik"}).
|
3477
3356
|
to_return(:status => 502)
|
3478
3357
|
lambda do
|
3479
3358
|
@cli.unfollow("sferik")
|
3480
3359
|
end.should raise_error("Twitter is down or being upgraded.")
|
3481
|
-
|
3482
|
-
with(:
|
3360
|
+
a_post("/1.1/friendships/destroy.json").
|
3361
|
+
with(:body => {:screen_name => "sferik"}).
|
3483
3362
|
should have_been_made.times(3)
|
3484
3363
|
end
|
3485
3364
|
end
|
@@ -3489,7 +3368,7 @@ WOEID Parent ID Type Name Country
|
|
3489
3368
|
describe "#update" do
|
3490
3369
|
before do
|
3491
3370
|
@cli.options = @cli.options.merge("profile" => fixture_path + "/.trc", "location" => true)
|
3492
|
-
stub_post("/1/statuses/update.json").
|
3371
|
+
stub_post("/1.1/statuses/update.json").
|
3493
3372
|
with(:body => {:status => "Testing", :lat => "37.76969909668", :long => "-122.39330291748", :trim_user => "true"}).
|
3494
3373
|
to_return(:body => fixture("status.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
3495
3374
|
stub_request(:get, "http://checkip.dyndns.org/").
|
@@ -3499,7 +3378,7 @@ WOEID Parent ID Type Name Country
|
|
3499
3378
|
end
|
3500
3379
|
it "should request the correct resource" do
|
3501
3380
|
@cli.update("Testing")
|
3502
|
-
a_post("/1/statuses/update.json").
|
3381
|
+
a_post("/1.1/statuses/update.json").
|
3503
3382
|
with(:body => {:status => "Testing", :lat => "37.76969909668", :long => "-122.39330291748", :trim_user => "true"}).
|
3504
3383
|
should have_been_made
|
3505
3384
|
a_request(:get, "http://checkip.dyndns.org/").
|
@@ -3514,12 +3393,12 @@ WOEID Parent ID Type Name Country
|
|
3514
3393
|
context "with file" do
|
3515
3394
|
before do
|
3516
3395
|
@cli.options = @cli.options.merge("file" => fixture_path + "/long.png")
|
3517
|
-
stub_post("/1/statuses/update_with_media.json"
|
3396
|
+
stub_post("/1.1/statuses/update_with_media.json").
|
3518
3397
|
to_return(:body => fixture("status.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
3519
3398
|
end
|
3520
3399
|
it "should request the correct resource" do
|
3521
3400
|
@cli.update("Testing")
|
3522
|
-
a_post("/1/statuses/update_with_media.json"
|
3401
|
+
a_post("/1.1/statuses/update_with_media.json").
|
3523
3402
|
should have_been_made
|
3524
3403
|
end
|
3525
3404
|
it "should have the correct output" do
|
@@ -3531,14 +3410,14 @@ WOEID Parent ID Type Name Country
|
|
3531
3410
|
|
3532
3411
|
describe "#users" do
|
3533
3412
|
before do
|
3534
|
-
|
3535
|
-
with(:
|
3413
|
+
stub_post("/1.1/users/lookup.json").
|
3414
|
+
with(:body => {:screen_name => "sferik,pengwynn"}).
|
3536
3415
|
to_return(:body => fixture("users.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
3537
3416
|
end
|
3538
3417
|
it "should request the correct resource" do
|
3539
3418
|
@cli.users("sferik", "pengwynn")
|
3540
|
-
|
3541
|
-
with(:
|
3419
|
+
a_post("/1.1/users/lookup.json").
|
3420
|
+
with(:body => {:screen_name => "sferik,pengwynn"}).
|
3542
3421
|
should have_been_made
|
3543
3422
|
end
|
3544
3423
|
it "should have the correct output" do
|
@@ -3610,14 +3489,14 @@ ID Since Last tweeted at Tweets Favorites Listed Following...
|
|
3610
3489
|
context "--id" do
|
3611
3490
|
before do
|
3612
3491
|
@cli.options = @cli.options.merge("id" => true)
|
3613
|
-
|
3614
|
-
with(:
|
3492
|
+
stub_post("/1.1/users/lookup.json").
|
3493
|
+
with(:body => {:user_id => "7505382,14100886"}).
|
3615
3494
|
to_return(:body => fixture("users.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
3616
3495
|
end
|
3617
3496
|
it "should request the correct resource" do
|
3618
3497
|
@cli.users("7505382", "14100886")
|
3619
|
-
|
3620
|
-
with(:
|
3498
|
+
a_post("/1.1/users/lookup.json").
|
3499
|
+
with(:body => {:user_id => "7505382,14100886"}).
|
3621
3500
|
should have_been_made
|
3622
3501
|
end
|
3623
3502
|
end
|
@@ -3677,13 +3556,13 @@ ID Since Last tweeted at Tweets Favorites Listed Following...
|
|
3677
3556
|
|
3678
3557
|
describe "#whois" do
|
3679
3558
|
before do
|
3680
|
-
stub_get("/1/users/show.json").
|
3559
|
+
stub_get("/1.1/users/show.json").
|
3681
3560
|
with(:query => {:screen_name => "sferik"}).
|
3682
3561
|
to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
3683
3562
|
end
|
3684
3563
|
it "should request the correct resource" do
|
3685
3564
|
@cli.whois("sferik")
|
3686
|
-
a_get("/1/users/show.json").
|
3565
|
+
a_get("/1.1/users/show.json").
|
3687
3566
|
with(:query => {:screen_name => "sferik"}).
|
3688
3567
|
should have_been_made
|
3689
3568
|
end
|
@@ -3720,13 +3599,13 @@ ID,Verified,Name,Screen name,Bio,Location,Following,Last update,Lasted updated a
|
|
3720
3599
|
context "--id" do
|
3721
3600
|
before do
|
3722
3601
|
@cli.options = @cli.options.merge("id" => true)
|
3723
|
-
stub_get("/1/users/show.json").
|
3602
|
+
stub_get("/1.1/users/show.json").
|
3724
3603
|
with(:query => {:user_id => "7505382"}).
|
3725
3604
|
to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
3726
3605
|
end
|
3727
3606
|
it "should request the correct resource" do
|
3728
3607
|
@cli.whois("7505382")
|
3729
|
-
a_get("/1/users/show.json").
|
3608
|
+
a_get("/1.1/users/show.json").
|
3730
3609
|
with(:query => {:user_id => "7505382"}).
|
3731
3610
|
should have_been_made
|
3732
3611
|
end
|