t 0.9.6 → 0.9.7
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 +29 -10
- data/bin/t +4 -25
- data/lib/t/cli.rb +24 -23
- data/lib/t/core_ext/kernel.rb +15 -0
- data/lib/t/core_ext/string.rb +4 -2
- data/lib/t/delete.rb +13 -13
- data/lib/t/format_helpers.rb +62 -0
- data/lib/t/list.rb +4 -4
- data/lib/t/printable.rb +27 -24
- data/lib/t/rcfile.rb +1 -1
- data/lib/t/requestable.rb +0 -4
- data/lib/t/search.rb +10 -11
- data/lib/t/stream.rb +57 -21
- data/lib/t/version.rb +1 -1
- data/lib/t.rb +22 -3
- data/spec/cli_spec.rb +53 -45
- data/spec/fixtures/501_ids.json +509 -1
- data/spec/fixtures/501_users_list.json +17543 -1
- data/spec/fixtures/direct_message.json +80 -1
- data/spec/fixtures/direct_messages.json +802 -1
- data/spec/fixtures/empty_cursor.json +7 -1
- data/spec/fixtures/favorites.json +1099 -1
- data/spec/fixtures/followers_ids.json +10 -1
- data/spec/fixtures/friends_ids.json +9 -1
- data/spec/fixtures/gem.json +61 -1
- data/spec/fixtures/list.json +54 -1
- data/spec/fixtures/lists.json +116 -1
- data/spec/fixtures/locations.json +57 -1
- data/spec/fixtures/not_found.json +4 -1
- data/spec/fixtures/rate_limit_status.json +6 -1
- data/spec/fixtures/recommendations.json +364 -1
- data/spec/fixtures/retweet.json +112 -1
- data/spec/fixtures/search.json +346 -1
- data/spec/fixtures/settings.json +30 -1
- data/spec/fixtures/sferik.json +76 -1
- data/spec/fixtures/status.json +109 -1
- data/spec/fixtures/status_no_attributes.json +104 -1
- data/spec/fixtures/status_no_country.json +102 -1
- data/spec/fixtures/status_no_full_name.json +101 -1
- data/spec/fixtures/status_no_locality.json +107 -1
- data/spec/fixtures/status_no_street_address.json +108 -1
- data/spec/fixtures/statuses.json +1105 -1
- data/spec/fixtures/trends.json +35 -1
- data/spec/fixtures/users.json +92 -1
- data/spec/fixtures/users_list.json +98 -1
- data/spec/list_spec.rb +13 -5
- data/spec/search_spec.rb +110 -102
- data/t.gemspec +1 -2
- metadata +6 -32
data/lib/t/search.rb
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
require 'action_view'
|
2
1
|
require 'csv'
|
3
2
|
# 'fastercsv' required on Ruby versions < 1.9
|
4
3
|
require 'fastercsv' unless Array.new.respond_to?(:to_csv)
|
@@ -11,7 +10,6 @@ require 'thor'
|
|
11
10
|
|
12
11
|
module T
|
13
12
|
class Search < Thor
|
14
|
-
include ActionView::Helpers::DateHelper
|
15
13
|
include T::Collectable
|
16
14
|
include T::Printable
|
17
15
|
include T::Requestable
|
@@ -40,13 +38,14 @@ module T
|
|
40
38
|
if options['csv']
|
41
39
|
say STATUS_HEADINGS.to_csv unless statuses.empty?
|
42
40
|
statuses.each do |status|
|
43
|
-
say [status.id, csv_formatted_time(status), status.from_user, HTMLEntities.new.decode(status.
|
41
|
+
say [status.id, csv_formatted_time(status), status.from_user, HTMLEntities.new.decode(status.full_text)].to_csv
|
44
42
|
end
|
45
43
|
elsif options['long']
|
46
44
|
array = statuses.map do |status|
|
47
|
-
[status.id, ls_formatted_time(status), "@#{status.from_user}", HTMLEntities.new.decode(status.
|
45
|
+
[status.id, ls_formatted_time(status), "@#{status.from_user}", HTMLEntities.new.decode(status.full_text).gsub(/\n+/, ' ')]
|
48
46
|
end
|
49
|
-
|
47
|
+
format = options['format'] || STATUS_HEADINGS.size.times.map{"%s"}
|
48
|
+
print_table_with_headings(array, STATUS_HEADINGS, format)
|
50
49
|
else
|
51
50
|
say unless statuses.empty?
|
52
51
|
statuses.each do |status|
|
@@ -65,7 +64,7 @@ module T
|
|
65
64
|
client.favorites(opts)
|
66
65
|
end
|
67
66
|
statuses = statuses.select do |status|
|
68
|
-
/#{query}/i.match(status.
|
67
|
+
/#{query}/i.match(status.full_text)
|
69
68
|
end
|
70
69
|
print_statuses(statuses)
|
71
70
|
end
|
@@ -93,7 +92,7 @@ module T
|
|
93
92
|
client.list_timeline(owner, list, opts)
|
94
93
|
end
|
95
94
|
statuses = statuses.select do |status|
|
96
|
-
/#{query}/i.match(status.
|
95
|
+
/#{query}/i.match(status.full_text)
|
97
96
|
end
|
98
97
|
print_statuses(statuses)
|
99
98
|
end
|
@@ -108,7 +107,7 @@ module T
|
|
108
107
|
client.mentions(opts)
|
109
108
|
end
|
110
109
|
statuses = statuses.select do |status|
|
111
|
-
/#{query}/i.match(status.
|
110
|
+
/#{query}/i.match(status.full_text)
|
112
111
|
end
|
113
112
|
print_statuses(statuses)
|
114
113
|
end
|
@@ -124,13 +123,13 @@ module T
|
|
124
123
|
client.retweeted_by(opts)
|
125
124
|
end
|
126
125
|
statuses = statuses.select do |status|
|
127
|
-
/#{query}/i.match(status.
|
126
|
+
/#{query}/i.match(status.full_text)
|
128
127
|
end
|
129
128
|
print_statuses(statuses)
|
130
129
|
end
|
131
130
|
map %w(rts) => :retweets
|
132
131
|
|
133
|
-
desc "timeline QUERY", "Returns Tweets in your timeline that match the specified query."
|
132
|
+
desc "timeline [USER] QUERY", "Returns Tweets in your timeline that match the specified query."
|
134
133
|
method_option "csv", :aliases => "-c", :type => :boolean, :default => false, :desc => "Output in CSV format."
|
135
134
|
method_option "id", :aliases => "-i", :type => "boolean", :default => false, :desc => "Specify user via ID instead of screen name."
|
136
135
|
method_option "long", :aliases => "-l", :type => :boolean, :default => false, :desc => "Output in long format."
|
@@ -155,7 +154,7 @@ module T
|
|
155
154
|
end
|
156
155
|
end
|
157
156
|
statuses = statuses.select do |status|
|
158
|
-
/#{query}/i.match(status.
|
157
|
+
/#{query}/i.match(status.full_text)
|
159
158
|
end
|
160
159
|
print_statuses(statuses)
|
161
160
|
end
|
data/lib/t/stream.rb
CHANGED
@@ -9,6 +9,13 @@ module T
|
|
9
9
|
class Stream < Thor
|
10
10
|
include T::Printable
|
11
11
|
|
12
|
+
STATUS_HEADINGS_FORMATTING = [
|
13
|
+
"%-18s", # Add padding to maximum length of a Tweet ID
|
14
|
+
"%-12s", # Add padding to length of a timestamp formatted with ls_formatted_time
|
15
|
+
"%-20s", # Add padding to maximum length of a Twitter screen name
|
16
|
+
"%s", # Last element does not need special formatting
|
17
|
+
]
|
18
|
+
|
12
19
|
def initialize(*)
|
13
20
|
super
|
14
21
|
@rcfile = RCFile.instance
|
@@ -16,87 +23,123 @@ module T
|
|
16
23
|
|
17
24
|
desc "all", "Stream a random sample of all Tweets (Control-C to stop)"
|
18
25
|
method_option "csv", :aliases => "-c", :type => :boolean, :default => false, :desc => "Output in CSV format."
|
26
|
+
method_option "long", :aliases => "-l", :type => :boolean, :default => false, :desc => "Output in long format."
|
19
27
|
def all
|
20
|
-
|
21
|
-
|
28
|
+
client.on_inited do
|
29
|
+
if options['csv']
|
30
|
+
say STATUS_HEADINGS.to_csv
|
31
|
+
elsif options['long'] && STDOUT.tty?
|
32
|
+
headings = STATUS_HEADINGS.size.times.map do |index|
|
33
|
+
STATUS_HEADINGS_FORMATTING[index] % STATUS_HEADINGS[index]
|
34
|
+
end
|
35
|
+
print_table([headings])
|
36
|
+
end
|
22
37
|
end
|
23
38
|
client.on_timeline_status do |status|
|
24
39
|
if options['csv']
|
25
40
|
print_csv_status(status)
|
41
|
+
elsif options['long']
|
42
|
+
array = build_long_status(status).each_with_index.map do |element, index|
|
43
|
+
STATUS_HEADINGS_FORMATTING[index] % element
|
44
|
+
end
|
45
|
+
print_table([array], :truncate => STDOUT.tty?)
|
26
46
|
else
|
27
47
|
print_status(status)
|
28
48
|
end
|
29
49
|
end
|
30
|
-
until_term
|
31
50
|
client.sample
|
32
51
|
end
|
33
52
|
|
34
53
|
desc "matrix", "Unfortunately, no one can be told what the Matrix is. You have to see it for yourself."
|
35
54
|
def matrix
|
36
55
|
client.on_timeline_status do |status|
|
37
|
-
say(status.
|
56
|
+
say(status.full_text.gsub("\n", ''), [:bold, :green, :on_black])
|
38
57
|
end
|
39
|
-
until_term
|
40
58
|
client.sample
|
41
59
|
end
|
42
60
|
|
43
61
|
desc "search KEYWORD [KEYWORD...]", "Stream Tweets that contain specified keywords, joined with logical ORs (Control-C to stop)"
|
44
62
|
method_option "csv", :aliases => "-c", :type => :boolean, :default => false, :desc => "Output in CSV format."
|
63
|
+
method_option "long", :aliases => "-l", :type => :boolean, :default => false, :desc => "Output in long format."
|
45
64
|
def search(keyword, *keywords)
|
46
65
|
keywords.unshift(keyword)
|
47
66
|
client.on_inited do
|
48
67
|
search = T::Search.new
|
49
68
|
search.options = search.options.merge(options)
|
50
69
|
search.options = search.options.merge(:reverse => true)
|
70
|
+
search.options = search.options.merge(:format => STATUS_HEADINGS_FORMATTING)
|
51
71
|
search.all(keywords.join(' OR '))
|
52
72
|
end
|
53
73
|
client.on_timeline_status do |status|
|
54
74
|
if options['csv']
|
55
75
|
print_csv_status(status)
|
76
|
+
elsif options['long']
|
77
|
+
array = build_long_status(status).each_with_index.map do |element, index|
|
78
|
+
STATUS_HEADINGS_FORMATTING[index] % element
|
79
|
+
end
|
80
|
+
print_table([array], :truncate => STDOUT.tty?)
|
56
81
|
else
|
57
82
|
print_status(status)
|
58
83
|
end
|
59
84
|
end
|
60
|
-
until_term
|
61
85
|
client.track(keywords)
|
62
86
|
end
|
63
87
|
|
64
88
|
desc "timeline", "Stream your timeline (Control-C to stop)"
|
65
89
|
method_option "csv", :aliases => "-c", :type => :boolean, :default => false, :desc => "Output in CSV format."
|
90
|
+
method_option "long", :aliases => "-l", :type => :boolean, :default => false, :desc => "Output in long format."
|
66
91
|
def timeline
|
67
92
|
client.on_inited do
|
68
93
|
cli = T::CLI.new
|
69
94
|
cli.options = cli.options.merge(options)
|
70
95
|
cli.options = cli.options.merge(:reverse => true)
|
96
|
+
cli.options = cli.options.merge(:format => STATUS_HEADINGS_FORMATTING)
|
71
97
|
cli.timeline
|
72
98
|
end
|
73
99
|
client.on_timeline_status do |status|
|
74
100
|
if options['csv']
|
75
101
|
print_csv_status(status)
|
102
|
+
elsif options['long']
|
103
|
+
array = build_long_status(status).each_with_index.map do |element, index|
|
104
|
+
STATUS_HEADINGS_FORMATTING[index] % element
|
105
|
+
end
|
106
|
+
print_table([array], :truncate => STDOUT.tty?)
|
76
107
|
else
|
77
108
|
print_status(status)
|
78
109
|
end
|
79
110
|
end
|
80
|
-
until_term
|
81
111
|
client.userstream
|
82
112
|
end
|
83
113
|
|
84
|
-
desc "users
|
114
|
+
desc "users USER_ID [USER_ID...]", "Stream Tweets either from or in reply to specified users (Control-C to stop)"
|
85
115
|
method_option "csv", :aliases => "-c", :type => :boolean, :default => false, :desc => "Output in CSV format."
|
86
|
-
|
87
|
-
|
88
|
-
|
116
|
+
method_option "long", :aliases => "-l", :type => :boolean, :default => false, :desc => "Output in long format."
|
117
|
+
def users(user_id, *user_ids)
|
118
|
+
user_ids.unshift(user_id)
|
119
|
+
user_ids.map!(&:to_i)
|
120
|
+
client.on_inited do
|
121
|
+
if options['csv']
|
122
|
+
say STATUS_HEADINGS.to_csv
|
123
|
+
elsif options['long'] && STDOUT.tty?
|
124
|
+
headings = STATUS_HEADINGS.size.times.map do |index|
|
125
|
+
STATUS_HEADINGS_FORMATTING[index] % STATUS_HEADINGS[index]
|
126
|
+
end
|
127
|
+
print_table([headings])
|
128
|
+
end
|
89
129
|
end
|
90
|
-
screen_names.unshift(screen_name)
|
91
130
|
client.on_timeline_status do |status|
|
92
131
|
if options['csv']
|
93
132
|
print_csv_status(status)
|
133
|
+
elsif options['long']
|
134
|
+
array = build_long_status(status).each_with_index.map do |element, index|
|
135
|
+
STATUS_HEADINGS_FORMATTING[index] % element
|
136
|
+
end
|
137
|
+
print_table([array], :truncate => STDOUT.tty?)
|
94
138
|
else
|
95
139
|
print_status(status)
|
96
140
|
end
|
97
141
|
end
|
98
|
-
|
99
|
-
client.follow(screen_names)
|
142
|
+
client.follow(user_ids)
|
100
143
|
end
|
101
144
|
|
102
145
|
private
|
@@ -112,12 +155,5 @@ module T
|
|
112
155
|
)
|
113
156
|
end
|
114
157
|
|
115
|
-
def until_term
|
116
|
-
Signal.trap("TERM") do
|
117
|
-
client.stop
|
118
|
-
shutdown
|
119
|
-
end
|
120
|
-
end
|
121
|
-
|
122
158
|
end
|
123
159
|
end
|
data/lib/t/version.rb
CHANGED
data/lib/t.rb
CHANGED
@@ -1,16 +1,35 @@
|
|
1
|
+
require 'time'
|
1
2
|
require 'active_support/string_inquirer'
|
2
3
|
require 't/cli'
|
3
4
|
|
4
5
|
module T
|
5
6
|
class << self
|
6
7
|
|
7
|
-
|
8
|
-
@env
|
9
|
-
end
|
8
|
+
attr_reader :env
|
10
9
|
|
11
10
|
def env=(environment)
|
12
11
|
@env = ActiveSupport::StringInquirer.new(environment)
|
13
12
|
end
|
14
13
|
|
14
|
+
# Convert time to local time by applying the `utc_offset` setting.
|
15
|
+
def local_time(time)
|
16
|
+
utc_offset ? (time.utc + utc_offset) : time.localtime
|
17
|
+
end
|
18
|
+
|
19
|
+
# UTC offset in seconds to apply time instances before displaying.
|
20
|
+
# If not set, time instances are displayed in default local time.
|
21
|
+
attr_reader :utc_offset
|
22
|
+
|
23
|
+
def utc_offset=(offset)
|
24
|
+
@utc_offset = case offset
|
25
|
+
when String
|
26
|
+
Time.zone_offset(offset)
|
27
|
+
when NilClass
|
28
|
+
nil
|
29
|
+
else
|
30
|
+
offset.to_i
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
15
34
|
end
|
16
35
|
end
|
data/spec/cli_spec.rb
CHANGED
@@ -3,6 +3,16 @@ require 'helper'
|
|
3
3
|
|
4
4
|
describe T::CLI do
|
5
5
|
|
6
|
+
before :all do
|
7
|
+
Timecop.freeze(Time.utc(2011, 11, 24, 16, 20, 0))
|
8
|
+
T.utc_offset = 'PST'
|
9
|
+
end
|
10
|
+
|
11
|
+
after :all do
|
12
|
+
T.utc_offset = nil
|
13
|
+
Timecop.return
|
14
|
+
end
|
15
|
+
|
6
16
|
before do
|
7
17
|
rcfile = RCFile.instance
|
8
18
|
rcfile.path = fixture_path + "/.trc"
|
@@ -11,11 +21,9 @@ describe T::CLI do
|
|
11
21
|
$stderr = StringIO.new
|
12
22
|
@old_stdout = $stdout
|
13
23
|
$stdout = StringIO.new
|
14
|
-
Timecop.freeze(Time.utc(2011, 11, 24, 16, 20, 0))
|
15
24
|
end
|
16
25
|
|
17
26
|
after do
|
18
|
-
Timecop.return
|
19
27
|
$stderr = @old_stderr
|
20
28
|
$stdout = @old_stdout
|
21
29
|
end
|
@@ -342,7 +350,7 @@ ID Posted at Screen name Text
|
|
342
350
|
end
|
343
351
|
end
|
344
352
|
|
345
|
-
describe "#
|
353
|
+
describe "#groupies" do
|
346
354
|
before do
|
347
355
|
stub_get("/1/followers/ids.json").
|
348
356
|
with(:query => {:cursor => "-1"}).
|
@@ -355,7 +363,7 @@ ID Posted at Screen name Text
|
|
355
363
|
to_return(:body => fixture("users.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
356
364
|
end
|
357
365
|
it "should request the correct resource" do
|
358
|
-
@cli.
|
366
|
+
@cli.groupies
|
359
367
|
a_get("/1/followers/ids.json").
|
360
368
|
with(:query => {:cursor => "-1"}).
|
361
369
|
should have_been_made
|
@@ -367,7 +375,7 @@ ID Posted at Screen name Text
|
|
367
375
|
should have_been_made
|
368
376
|
end
|
369
377
|
it "should have the correct output" do
|
370
|
-
@cli.
|
378
|
+
@cli.groupies
|
371
379
|
$stdout.string.rstrip.should == "pengwynn sferik"
|
372
380
|
end
|
373
381
|
context "--csv" do
|
@@ -375,7 +383,7 @@ ID Posted at Screen name Text
|
|
375
383
|
@cli.options = @cli.options.merge("csv" => true)
|
376
384
|
end
|
377
385
|
it "should output in CSV format" do
|
378
|
-
@cli.
|
386
|
+
@cli.groupies
|
379
387
|
$stdout.string.should == <<-eos
|
380
388
|
ID,Since,Tweets,Favorites,Listed,Following,Followers,Screen name,Name
|
381
389
|
14100886,2008-03-08 16:34:22 +0000,3913,32,185,1871,2767,pengwynn,Wynn Netherland
|
@@ -388,7 +396,7 @@ ID,Since,Tweets,Favorites,Listed,Following,Followers,Screen name,Name
|
|
388
396
|
@cli.options = @cli.options.merge("favorites" => true)
|
389
397
|
end
|
390
398
|
it "should sort by number of favorites" do
|
391
|
-
@cli.
|
399
|
+
@cli.groupies
|
392
400
|
$stdout.string.rstrip.should == "pengwynn sferik"
|
393
401
|
end
|
394
402
|
end
|
@@ -397,7 +405,7 @@ ID,Since,Tweets,Favorites,Listed,Following,Followers,Screen name,Name
|
|
397
405
|
@cli.options = @cli.options.merge("followers" => true)
|
398
406
|
end
|
399
407
|
it "should sort by number of followers" do
|
400
|
-
@cli.
|
408
|
+
@cli.groupies
|
401
409
|
$stdout.string.rstrip.should == "sferik pengwynn"
|
402
410
|
end
|
403
411
|
end
|
@@ -406,7 +414,7 @@ ID,Since,Tweets,Favorites,Listed,Following,Followers,Screen name,Name
|
|
406
414
|
@cli.options = @cli.options.merge("friends" => true)
|
407
415
|
end
|
408
416
|
it "should sort by number of friends" do
|
409
|
-
@cli.
|
417
|
+
@cli.groupies
|
410
418
|
$stdout.string.rstrip.should == "sferik pengwynn"
|
411
419
|
end
|
412
420
|
end
|
@@ -415,7 +423,7 @@ ID,Since,Tweets,Favorites,Listed,Following,Followers,Screen name,Name
|
|
415
423
|
@cli.options = @cli.options.merge("listed" => true)
|
416
424
|
end
|
417
425
|
it "should sort by number of list memberships" do
|
418
|
-
@cli.
|
426
|
+
@cli.groupies
|
419
427
|
$stdout.string.rstrip.should == "sferik pengwynn"
|
420
428
|
end
|
421
429
|
end
|
@@ -424,11 +432,11 @@ ID,Since,Tweets,Favorites,Listed,Following,Followers,Screen name,Name
|
|
424
432
|
@cli.options = @cli.options.merge("long" => true)
|
425
433
|
end
|
426
434
|
it "should output in long format" do
|
427
|
-
@cli.
|
435
|
+
@cli.groupies
|
428
436
|
$stdout.string.should == <<-eos
|
429
437
|
ID Since Tweets Favorites Listed Following Followers Scre...
|
430
|
-
14100886 Mar 8 2008
|
431
|
-
7505382 Jul 16 2007
|
438
|
+
14100886 Mar 8 2008 3913 32 185 1871 2767 @pen...
|
439
|
+
7505382 Jul 16 2007 2962 727 29 88 898 @sfe...
|
432
440
|
eos
|
433
441
|
end
|
434
442
|
end
|
@@ -437,7 +445,7 @@ ID Since Tweets Favorites Listed Following Followers Scre...
|
|
437
445
|
@cli.options = @cli.options.merge("posted" => true)
|
438
446
|
end
|
439
447
|
it "should sort by the time when Twitter acount was created" do
|
440
|
-
@cli.
|
448
|
+
@cli.groupies
|
441
449
|
$stdout.string.rstrip.should == "sferik pengwynn"
|
442
450
|
end
|
443
451
|
end
|
@@ -446,7 +454,7 @@ ID Since Tweets Favorites Listed Following Followers Scre...
|
|
446
454
|
@cli.options = @cli.options.merge("reverse" => true)
|
447
455
|
end
|
448
456
|
it "should reverse the order of the sort" do
|
449
|
-
@cli.
|
457
|
+
@cli.groupies
|
450
458
|
$stdout.string.rstrip.should == "sferik pengwynn"
|
451
459
|
end
|
452
460
|
end
|
@@ -455,7 +463,7 @@ ID Since Tweets Favorites Listed Following Followers Scre...
|
|
455
463
|
@cli.options = @cli.options.merge("tweets" => true)
|
456
464
|
end
|
457
465
|
it "should sort by number of Tweets" do
|
458
|
-
@cli.
|
466
|
+
@cli.groupies
|
459
467
|
$stdout.string.rstrip.should == "sferik pengwynn"
|
460
468
|
end
|
461
469
|
end
|
@@ -464,7 +472,7 @@ ID Since Tweets Favorites Listed Following Followers Scre...
|
|
464
472
|
@cli.options = @cli.options.merge("unsorted" => true)
|
465
473
|
end
|
466
474
|
it "should not be sorted" do
|
467
|
-
@cli.
|
475
|
+
@cli.groupies
|
468
476
|
$stdout.string.rstrip.should == "sferik pengwynn"
|
469
477
|
end
|
470
478
|
end
|
@@ -478,7 +486,7 @@ ID Since Tweets Favorites Listed Following Followers Scre...
|
|
478
486
|
to_return(:body => fixture("friends_ids.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
479
487
|
end
|
480
488
|
it "should request the correct resource" do
|
481
|
-
@cli.
|
489
|
+
@cli.groupies("sferik")
|
482
490
|
a_get("/1/followers/ids.json").
|
483
491
|
with(:query => {:cursor => "-1", :screen_name => "sferik"}).
|
484
492
|
should have_been_made
|
@@ -500,7 +508,7 @@ ID Since Tweets Favorites Listed Following Followers Scre...
|
|
500
508
|
to_return(:body => fixture("friends_ids.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
501
509
|
end
|
502
510
|
it "should request the correct resource" do
|
503
|
-
@cli.
|
511
|
+
@cli.groupies("7505382")
|
504
512
|
a_get("/1/followers/ids.json").
|
505
513
|
with(:query => {:cursor => "-1", :user_id => "7505382"}).
|
506
514
|
should have_been_made
|
@@ -1028,8 +1036,8 @@ ID,Since,Tweets,Favorites,Listed,Following,Followers,Screen name,Name
|
|
1028
1036
|
@cli.followings
|
1029
1037
|
$stdout.string.should == <<-eos
|
1030
1038
|
ID Since Tweets Favorites Listed Following Followers Scre...
|
1031
|
-
14100886 Mar 8 2008
|
1032
|
-
7505382 Jul 16 2007
|
1039
|
+
14100886 Mar 8 2008 3913 32 185 1871 2767 @pen...
|
1040
|
+
7505382 Jul 16 2007 2962 727 29 88 898 @sfe...
|
1033
1041
|
eos
|
1034
1042
|
end
|
1035
1043
|
end
|
@@ -1183,8 +1191,8 @@ ID,Since,Tweets,Favorites,Listed,Following,Followers,Screen name,Name
|
|
1183
1191
|
@cli.followers
|
1184
1192
|
$stdout.string.should == <<-eos
|
1185
1193
|
ID Since Tweets Favorites Listed Following Followers Scre...
|
1186
|
-
14100886 Mar 8 2008
|
1187
|
-
7505382 Jul 16 2007
|
1194
|
+
14100886 Mar 8 2008 3913 32 185 1871 2767 @pen...
|
1195
|
+
7505382 Jul 16 2007 2962 727 29 88 898 @sfe...
|
1188
1196
|
eos
|
1189
1197
|
end
|
1190
1198
|
end
|
@@ -1347,8 +1355,8 @@ ID,Since,Tweets,Favorites,Listed,Following,Followers,Screen name,Name
|
|
1347
1355
|
@cli.friends
|
1348
1356
|
$stdout.string.should == <<-eos
|
1349
1357
|
ID Since Tweets Favorites Listed Following Followers Scre...
|
1350
|
-
14100886 Mar 8 2008
|
1351
|
-
7505382 Jul 16 2007
|
1358
|
+
14100886 Mar 8 2008 3913 32 185 1871 2767 @pen...
|
1359
|
+
7505382 Jul 16 2007 2962 727 29 88 898 @sfe...
|
1352
1360
|
eos
|
1353
1361
|
end
|
1354
1362
|
end
|
@@ -1520,8 +1528,8 @@ ID,Since,Tweets,Favorites,Listed,Following,Followers,Screen name,Name
|
|
1520
1528
|
@cli.leaders
|
1521
1529
|
$stdout.string.should == <<-eos
|
1522
1530
|
ID Since Tweets Favorites Listed Following Followers Scre...
|
1523
|
-
14100886 Mar 8 2008
|
1524
|
-
7505382 Jul 16 2007
|
1531
|
+
14100886 Mar 8 2008 3913 32 185 1871 2767 @pen...
|
1532
|
+
7505382 Jul 16 2007 2962 727 29 88 898 @sfe...
|
1525
1533
|
eos
|
1526
1534
|
end
|
1527
1535
|
end
|
@@ -1645,8 +1653,8 @@ ID,Created at,Screen name,Slug,Members,Subscribers,Mode,Description
|
|
1645
1653
|
@cli.lists
|
1646
1654
|
$stdout.string.should == <<-eos
|
1647
1655
|
ID Created at Screen name Slug Members Subscribers ...
|
1648
|
-
21718825 Sep 14 2010 @sferik code-for-america
|
1649
|
-
8863586 Mar 15 2010 @sferik presidents
|
1656
|
+
21718825 Sep 14 2010 @sferik code-for-america 26 5 ...
|
1657
|
+
8863586 Mar 15 2010 @sferik presidents 2 1 ...
|
1650
1658
|
eos
|
1651
1659
|
end
|
1652
1660
|
end
|
@@ -1926,7 +1934,7 @@ ID Posted at Screen name Text
|
|
1926
1934
|
$stdout.string.should == <<-eos
|
1927
1935
|
Hourly limit 20,000
|
1928
1936
|
Remaining hits 19,993
|
1929
|
-
Reset time Oct
|
1937
|
+
Reset time Oct 26 2010 (about 1 year from now)
|
1930
1938
|
eos
|
1931
1939
|
end
|
1932
1940
|
context "--csv" do
|
@@ -1937,7 +1945,7 @@ Reset time Oct 25 2010
|
|
1937
1945
|
@cli.rate_limit
|
1938
1946
|
$stdout.string.should == <<-eos
|
1939
1947
|
Hourly limit,Remaining hits,Reset time
|
1940
|
-
20000,19993,2010-10-26
|
1948
|
+
20000,19993,2010-10-26 12:43:08 +0000
|
1941
1949
|
eos
|
1942
1950
|
end
|
1943
1951
|
end
|
@@ -2237,7 +2245,7 @@ ID Posted at Screen name Text
|
|
2237
2245
|
ID 55709764298092545
|
2238
2246
|
Text The problem with your code is that it's doing exactly what you told it to do.
|
2239
2247
|
Screen name @sferik
|
2240
|
-
Posted at Apr 6 2011
|
2248
|
+
Posted at Apr 6 2011 (8 months ago)
|
2241
2249
|
Location Blowfish Sushi To Die For, 2170 Bryant St, San Francisco, California, United States
|
2242
2250
|
Retweets 320
|
2243
2251
|
Source Twitter for iPhone
|
@@ -2268,7 +2276,7 @@ ID,Text,Screen name,Posted at,Location,Retweets,Source,URL
|
|
2268
2276
|
ID 55709764298092545
|
2269
2277
|
Text The problem with your code is that it's doing exactly what you told it to do.
|
2270
2278
|
Screen name @sferik
|
2271
|
-
Posted at Apr 6 2011
|
2279
|
+
Posted at Apr 6 2011 (8 months ago)
|
2272
2280
|
Location Blowfish Sushi To Die For, San Francisco, California, United States
|
2273
2281
|
Retweets 320
|
2274
2282
|
Source Twitter for iPhone
|
@@ -2288,7 +2296,7 @@ URL https://twitter.com/sferik/status/55709764298092545
|
|
2288
2296
|
ID 55709764298092545
|
2289
2297
|
Text The problem with your code is that it's doing exactly what you told it to do.
|
2290
2298
|
Screen name @sferik
|
2291
|
-
Posted at Apr 6 2011
|
2299
|
+
Posted at Apr 6 2011 (8 months ago)
|
2292
2300
|
Location Blowfish Sushi To Die For, San Francisco, California, United States
|
2293
2301
|
Retweets 320
|
2294
2302
|
Source Twitter for iPhone
|
@@ -2308,7 +2316,7 @@ URL https://twitter.com/sferik/status/55709764298092545
|
|
2308
2316
|
ID 55709764298092545
|
2309
2317
|
Text The problem with your code is that it's doing exactly what you told it to do.
|
2310
2318
|
Screen name @sferik
|
2311
|
-
Posted at Apr 6 2011
|
2319
|
+
Posted at Apr 6 2011 (8 months ago)
|
2312
2320
|
Location Blowfish Sushi To Die For, San Francisco, United States
|
2313
2321
|
Retweets 320
|
2314
2322
|
Source Twitter for iPhone
|
@@ -2328,7 +2336,7 @@ URL https://twitter.com/sferik/status/55709764298092545
|
|
2328
2336
|
ID 55709764298092545
|
2329
2337
|
Text The problem with your code is that it's doing exactly what you told it to do.
|
2330
2338
|
Screen name @sferik
|
2331
|
-
Posted at Apr 6 2011
|
2339
|
+
Posted at Apr 6 2011 (8 months ago)
|
2332
2340
|
Location Blowfish Sushi To Die For, San Francisco
|
2333
2341
|
Retweets 320
|
2334
2342
|
Source Twitter for iPhone
|
@@ -2348,7 +2356,7 @@ URL https://twitter.com/sferik/status/55709764298092545
|
|
2348
2356
|
ID 55709764298092545
|
2349
2357
|
Text The problem with your code is that it's doing exactly what you told it to do.
|
2350
2358
|
Screen name @sferik
|
2351
|
-
Posted at Apr 6 2011
|
2359
|
+
Posted at Apr 6 2011 (8 months ago)
|
2352
2360
|
Location Blowfish Sushi To Die For
|
2353
2361
|
Retweets 320
|
2354
2362
|
Source Twitter for iPhone
|
@@ -2438,11 +2446,11 @@ ID,Since,Tweets,Favorites,Listed,Following,Followers,Screen name,Name
|
|
2438
2446
|
@cli.suggest
|
2439
2447
|
$stdout.string.should == <<-eos
|
2440
2448
|
ID Since Tweets Favorites Listed Following Followers Scre...
|
2441
|
-
40514587 May 16 2009
|
2442
|
-
14736332 May 11 2008
|
2443
|
-
2006261 Mar 23 2007
|
2444
|
-
14451152 Apr 20 2008
|
2445
|
-
16052754 Aug 30 2008
|
2449
|
+
40514587 May 16 2009 183 2 2 198 158 @ant...
|
2450
|
+
14736332 May 11 2008 3850 117 99 545 802 @jtr...
|
2451
|
+
2006261 Mar 23 2007 4497 9 171 967 2028 @mac...
|
2452
|
+
14451152 Apr 20 2008 6251 10 20 403 299 @mlr...
|
2453
|
+
16052754 Aug 30 2008 24 0 1 5 42 @stu...
|
2446
2454
|
eos
|
2447
2455
|
end
|
2448
2456
|
end
|
@@ -2997,8 +3005,8 @@ ID,Since,Tweets,Favorites,Listed,Following,Followers,Screen name,Name
|
|
2997
3005
|
@cli.users("sferik", "pengwynn")
|
2998
3006
|
$stdout.string.should == <<-eos
|
2999
3007
|
ID Since Tweets Favorites Listed Following Followers Scre...
|
3000
|
-
14100886 Mar 8 2008
|
3001
|
-
7505382 Jul 16 2007
|
3008
|
+
14100886 Mar 8 2008 3913 32 185 1871 2767 @pen...
|
3009
|
+
7505382 Jul 16 2007 2962 727 29 88 898 @sfe...
|
3002
3010
|
eos
|
3003
3011
|
end
|
3004
3012
|
end
|
@@ -3068,7 +3076,7 @@ Bio A mind forever voyaging through strange seas of thought, alone.
|
|
3068
3076
|
Location San Francisco
|
3069
3077
|
Status Not following
|
3070
3078
|
Last update RT @tenderlove: [ANN] sqlite3-ruby => sqlite3 (10 months ago)
|
3071
|
-
Since Jul 16 2007
|
3079
|
+
Since Jul 16 2007 (over 4 years ago)
|
3072
3080
|
Tweets 3,479
|
3073
3081
|
Favorites 1,040
|
3074
3082
|
Listed 41
|