t 1.5.1 → 1.6.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/lib/t/cli.rb +18 -16
- data/lib/t/printable.rb +3 -4
- data/lib/t/utils.rb +1 -0
- data/lib/t/version.rb +22 -20
- data/spec/cli_spec.rb +60 -45
- data/spec/list_spec.rb +3 -3
- data/spec/search_spec.rb +3 -3
- data/t.gemspec +1 -5
- metadata +3 -67
data/lib/t/cli.rb
CHANGED
@@ -594,6 +594,7 @@ module T
|
|
594
594
|
|
595
595
|
desc "status TWEET_ID", "Retrieves detailed information about a Tweet."
|
596
596
|
method_option "csv", :aliases => "-c", :type => :boolean, :default => false, :desc => "Output in CSV format."
|
597
|
+
method_option "long", :aliases => "-l", :type => :boolean, :default => false, :desc => "Output in long format."
|
597
598
|
def status(status_id)
|
598
599
|
status = client.status(status_id.to_i, :include_my_retweet => false)
|
599
600
|
status_activity = client.status_activity(status_id.to_i)
|
@@ -614,24 +615,27 @@ module T
|
|
614
615
|
elsif status.geo
|
615
616
|
reverse_geocode(status.geo)
|
616
617
|
end
|
617
|
-
|
618
|
+
status_headings = ["ID", "Posted at", "Screen name", "Text", "Retweets", "Favorites", "Replies", "Source", "Location"]
|
618
619
|
if options['csv']
|
619
620
|
require 'csv'
|
620
621
|
require 'fastercsv' unless Array.new.respond_to?(:to_csv)
|
621
|
-
say
|
622
|
-
say [status.id,
|
622
|
+
say status_headings.to_csv
|
623
|
+
say [status.id, csv_formatted_time(status), status.from_user, decode_full_text(status), status.retweet_count, status_activity.favoriters_count, status_activity.repliers_count, strip_tags(status.source), location].to_csv
|
624
|
+
elsif options['long']
|
625
|
+
array = [status.id, ls_formatted_time(status), "@#{status.from_user}", decode_full_text(status).gsub(/\n+/, ' '), status.retweet_count, status_activity.favoriters_count, status_activity.repliers_count, strip_tags(status.source), location]
|
626
|
+
format = options['format'] || status_headings.size.times.map{"%s"}
|
627
|
+
print_table_with_headings([array], status_headings, format)
|
623
628
|
else
|
624
629
|
array = []
|
625
630
|
array << ["ID", status.id.to_s]
|
626
|
-
array << ["Text",
|
631
|
+
array << ["Text", decode_full_text(status).gsub(/\n+/, ' ')]
|
627
632
|
array << ["Screen name", "@#{status.from_user}"]
|
628
633
|
array << ["Posted at", "#{ls_formatted_time(status)} (#{time_ago_in_words(status.created_at)} ago)"]
|
629
|
-
array << ["Location", location] unless location.nil?
|
630
634
|
array << ["Retweets", number_with_delimiter(status.retweet_count)]
|
631
635
|
array << ["Favorites", number_with_delimiter(status_activity.favoriters_count)]
|
632
636
|
array << ["Replies", number_with_delimiter(status_activity.repliers_count)]
|
633
637
|
array << ["Source", strip_tags(status.source)]
|
634
|
-
array << ["
|
638
|
+
array << ["Location", location] unless location.nil?
|
635
639
|
print_table(array)
|
636
640
|
end
|
637
641
|
end
|
@@ -779,6 +783,7 @@ module T
|
|
779
783
|
desc "whois USER", "Retrieves profile information for the user."
|
780
784
|
method_option "csv", :aliases => "-c", :type => :boolean, :default => false, :desc => "Output in CSV format."
|
781
785
|
method_option "id", :aliases => "-i", :type => :boolean, :default => false, :desc => "Specify user via ID instead of screen name."
|
786
|
+
method_option "long", :aliases => "-l", :type => :boolean, :default => false, :desc => "Output in long format."
|
782
787
|
def whois(user)
|
783
788
|
require 't/core_ext/string'
|
784
789
|
user = if options['id']
|
@@ -788,25 +793,22 @@ module T
|
|
788
793
|
end
|
789
794
|
user = client.user(user)
|
790
795
|
require 'htmlentities'
|
791
|
-
if options['csv']
|
792
|
-
|
793
|
-
require 'fastercsv' unless Array.new.respond_to?(:to_csv)
|
794
|
-
say ["ID", "Verified", "Name", "Screen name", "Bio", "Location", "Following", "Last update", "Lasted updated at", "Since", "Tweets", "Favorites", "Listed", "Following", "Followers", "URL"].to_csv
|
795
|
-
say [user.id, user.verified?, user.name, user.screen_name, user.description, user.location, user.following?, HTMLEntities.new.decode(user.status.text), csv_formatted_time(user.status), csv_formatted_time(user), user.statuses_count, user.favourites_count, user.listed_count, user.friends_count, user.followers_count, user.url].to_csv
|
796
|
+
if options['csv'] || options['long']
|
797
|
+
print_users([user])
|
796
798
|
else
|
797
799
|
array = []
|
798
800
|
array << ["ID", user.id.to_s]
|
799
|
-
array << [user.verified ? "Name (Verified)" : "Name", user.name] unless user.name.nil?
|
800
|
-
array << ["Bio", user.description.gsub(/\n+/, ' ')] unless user.description.nil?
|
801
|
-
array << ["Location", user.location] unless user.location.nil?
|
802
|
-
array << ["Status", user.following ? "Following" : "Not following"]
|
803
|
-
array << ["Last update", "#{HTMLEntities.new.decode(user.status.text).gsub(/\n+/, ' ')} (#{time_ago_in_words(user.status.created_at)} ago)"] unless user.status.nil?
|
804
801
|
array << ["Since", "#{ls_formatted_time(user)} (#{time_ago_in_words(user.created_at)} ago)"]
|
802
|
+
array << ["Last update", "#{decode_full_text(user.status).gsub(/\n+/, ' ')} (#{time_ago_in_words(user.status.created_at)} ago)"] unless user.status.nil?
|
803
|
+
array << ["Screen name", "@#{user.screen_name}"]
|
804
|
+
array << [user.verified ? "Name (Verified)" : "Name", user.name] unless user.name.nil?
|
805
805
|
array << ["Tweets", number_with_delimiter(user.statuses_count)]
|
806
806
|
array << ["Favorites", number_with_delimiter(user.favourites_count)]
|
807
807
|
array << ["Listed", number_with_delimiter(user.listed_count)]
|
808
808
|
array << ["Following", number_with_delimiter(user.friends_count)]
|
809
809
|
array << ["Followers", number_with_delimiter(user.followers_count)]
|
810
|
+
array << ["Bio", user.description.gsub(/\n+/, ' ')] unless user.description.nil?
|
811
|
+
array << ["Location", user.location] unless user.location.nil?
|
810
812
|
array << ["URL", user.url] unless user.url.nil?
|
811
813
|
print_table(array)
|
812
814
|
end
|
data/lib/t/printable.rb
CHANGED
@@ -2,7 +2,7 @@ module T
|
|
2
2
|
module Printable
|
3
3
|
LIST_HEADINGS = ["ID", "Created at", "Screen name", "Slug", "Members", "Subscribers", "Mode", "Description"]
|
4
4
|
TWEET_HEADINGS = ["ID", "Posted at", "Screen name", "Text"]
|
5
|
-
USER_HEADINGS = ["ID", "Since", "Last tweeted at", "Tweets", "Favorites", "Listed", "Following", "Followers", "Screen name", "Name"]
|
5
|
+
USER_HEADINGS = ["ID", "Since", "Last tweeted at", "Tweets", "Favorites", "Listed", "Following", "Followers", "Screen name", "Name", "Verified", "Bio", "Status", "Location", "URL"]
|
6
6
|
MONTH_IN_SECONDS = 2592000
|
7
7
|
|
8
8
|
private
|
@@ -12,12 +12,11 @@ module T
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def build_long_tweet(tweet)
|
15
|
-
require 'htmlentities'
|
16
15
|
[tweet.id, ls_formatted_time(tweet), "@#{tweet.from_user}", decode_full_text(tweet, options['decode_urls']).gsub(/\n+/, ' ')]
|
17
16
|
end
|
18
17
|
|
19
18
|
def build_long_user(user)
|
20
|
-
[user.id, ls_formatted_time(user), ls_formatted_time(user.status), user.statuses_count, user.favourites_count, user.listed_count, user.friends_count, user.followers_count, "@#{user.screen_name}", user.name]
|
19
|
+
[user.id, ls_formatted_time(user), ls_formatted_time(user.status), user.statuses_count, user.favourites_count, user.listed_count, user.friends_count, user.followers_count, "@#{user.screen_name}", user.name, user.verified? ? "Yes" : "No", decode_full_text(user.status, options['decode_urls']).gsub(/\n+/, ' '), user.location, user.url]
|
21
20
|
end
|
22
21
|
|
23
22
|
def csv_formatted_time(object, key=:created_at)
|
@@ -52,7 +51,7 @@ module T
|
|
52
51
|
def print_csv_user(user)
|
53
52
|
require 'csv'
|
54
53
|
require 'fastercsv' unless Array.new.respond_to?(:to_csv)
|
55
|
-
say [user.id, csv_formatted_time(user), csv_formatted_time(user.status), user.statuses_count, user.favourites_count, user.listed_count, user.friends_count, user.followers_count, user.screen_name, user.name].to_csv
|
54
|
+
say [user.id, csv_formatted_time(user), csv_formatted_time(user.status), user.statuses_count, user.favourites_count, user.listed_count, user.friends_count, user.followers_count, user.screen_name, user.name, user.verified?, user.description, user.status.text, user.location, user.url].to_csv
|
56
55
|
end
|
57
56
|
|
58
57
|
def print_lists(lists)
|
data/lib/t/utils.rb
CHANGED
data/lib/t/version.rb
CHANGED
@@ -1,30 +1,32 @@
|
|
1
1
|
module T
|
2
2
|
class Version
|
3
|
+
class << self
|
3
4
|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
5
|
+
# @return [Integer]
|
6
|
+
def major
|
7
|
+
1
|
8
|
+
end
|
8
9
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
10
|
+
# @return [Integer]
|
11
|
+
def minor
|
12
|
+
6
|
13
|
+
end
|
13
14
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
15
|
+
# @return [Integer]
|
16
|
+
def patch
|
17
|
+
0
|
18
|
+
end
|
18
19
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
20
|
+
# @return [String, NilClass]
|
21
|
+
def pre
|
22
|
+
nil
|
23
|
+
end
|
23
24
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
25
|
+
# @return [String]
|
26
|
+
def to_s
|
27
|
+
[major, minor, patch, pre].compact.join('.')
|
28
|
+
end
|
28
29
|
|
30
|
+
end
|
29
31
|
end
|
30
32
|
end
|
data/spec/cli_spec.rb
CHANGED
@@ -484,9 +484,9 @@ ID Posted at Screen name Text
|
|
484
484
|
it "outputs in CSV format" do
|
485
485
|
@cli.groupies
|
486
486
|
expect($stdout.string).to eq <<-eos
|
487
|
-
ID,Since,Last tweeted at,Tweets,Favorites,Listed,Following,Followers,Screen name,Name
|
488
|
-
14100886,2008-03-08 16:34:22 +0000,2012-07-07 20:33:19 +0000,6940,192,358,3427,5457,pengwynn,Wynn Netherland
|
489
|
-
7505382,2007-07-16 12:59:01 +0000,2012-07-08 18:29:20 +0000,7890,3755,118,212,2262,sferik,Erik Michaels-Ober
|
487
|
+
ID,Since,Last tweeted at,Tweets,Favorites,Listed,Following,Followers,Screen name,Name,Verified,Bio,Status,Location,URL
|
488
|
+
14100886,2008-03-08 16:34:22 +0000,2012-07-07 20:33:19 +0000,6940,192,358,3427,5457,pengwynn,Wynn Netherland ⚡,false,"Christian, husband, father, GitHubber, Co-host of @thechangelog, Co-author of Sass, Compass, #CSS book http://wynn.fm/sass-meap",@akosmasoftware Sass book! @hcatlin @nex3 are the brains behind Sass. :-),"Denton, TX",http://wynnnetherland.com
|
489
|
+
7505382,2007-07-16 12:59:01 +0000,2012-07-08 18:29:20 +0000,7890,3755,118,212,2262,sferik,Erik Michaels-Ober,false,Vagabond.,@goldman You're near my home town! Say hi to Woodstock for me.,San Francisco,https://github.com/sferik
|
490
490
|
eos
|
491
491
|
end
|
492
492
|
end
|
@@ -1077,9 +1077,9 @@ ID Posted at Screen name Text
|
|
1077
1077
|
it "outputs in CSV format" do
|
1078
1078
|
@cli.followings
|
1079
1079
|
expect($stdout.string).to eq <<-eos
|
1080
|
-
ID,Since,Last tweeted at,Tweets,Favorites,Listed,Following,Followers,Screen name,Name
|
1081
|
-
14100886,2008-03-08 16:34:22 +0000,2012-07-07 20:33:19 +0000,6940,192,358,3427,5457,pengwynn,Wynn Netherland
|
1082
|
-
7505382,2007-07-16 12:59:01 +0000,2012-07-08 18:29:20 +0000,7890,3755,118,212,2262,sferik,Erik Michaels-Ober
|
1080
|
+
ID,Since,Last tweeted at,Tweets,Favorites,Listed,Following,Followers,Screen name,Name,Verified,Bio,Status,Location,URL
|
1081
|
+
14100886,2008-03-08 16:34:22 +0000,2012-07-07 20:33:19 +0000,6940,192,358,3427,5457,pengwynn,Wynn Netherland ⚡,false,"Christian, husband, father, GitHubber, Co-host of @thechangelog, Co-author of Sass, Compass, #CSS book http://wynn.fm/sass-meap",@akosmasoftware Sass book! @hcatlin @nex3 are the brains behind Sass. :-),"Denton, TX",http://wynnnetherland.com
|
1082
|
+
7505382,2007-07-16 12:59:01 +0000,2012-07-08 18:29:20 +0000,7890,3755,118,212,2262,sferik,Erik Michaels-Ober,false,Vagabond.,@goldman You're near my home town! Say hi to Woodstock for me.,San Francisco,https://github.com/sferik
|
1083
1083
|
eos
|
1084
1084
|
end
|
1085
1085
|
end
|
@@ -1221,9 +1221,9 @@ ID Since Last tweeted at Tweets Favorites Listed Following...
|
|
1221
1221
|
it "outputs in CSV format" do
|
1222
1222
|
@cli.followers
|
1223
1223
|
expect($stdout.string).to eq <<-eos
|
1224
|
-
ID,Since,Last tweeted at,Tweets,Favorites,Listed,Following,Followers,Screen name,Name
|
1225
|
-
14100886,2008-03-08 16:34:22 +0000,2012-07-07 20:33:19 +0000,6940,192,358,3427,5457,pengwynn,Wynn Netherland
|
1226
|
-
7505382,2007-07-16 12:59:01 +0000,2012-07-08 18:29:20 +0000,7890,3755,118,212,2262,sferik,Erik Michaels-Ober
|
1224
|
+
ID,Since,Last tweeted at,Tweets,Favorites,Listed,Following,Followers,Screen name,Name,Verified,Bio,Status,Location,URL
|
1225
|
+
14100886,2008-03-08 16:34:22 +0000,2012-07-07 20:33:19 +0000,6940,192,358,3427,5457,pengwynn,Wynn Netherland ⚡,false,"Christian, husband, father, GitHubber, Co-host of @thechangelog, Co-author of Sass, Compass, #CSS book http://wynn.fm/sass-meap",@akosmasoftware Sass book! @hcatlin @nex3 are the brains behind Sass. :-),"Denton, TX",http://wynnnetherland.com
|
1226
|
+
7505382,2007-07-16 12:59:01 +0000,2012-07-08 18:29:20 +0000,7890,3755,118,212,2262,sferik,Erik Michaels-Ober,false,Vagabond.,@goldman You're near my home town! Say hi to Woodstock for me.,San Francisco,https://github.com/sferik
|
1227
1227
|
eos
|
1228
1228
|
end
|
1229
1229
|
end
|
@@ -1368,9 +1368,9 @@ ID Since Last tweeted at Tweets Favorites Listed Following...
|
|
1368
1368
|
it "outputs in CSV format" do
|
1369
1369
|
@cli.friends
|
1370
1370
|
expect($stdout.string).to eq <<-eos
|
1371
|
-
ID,Since,Last tweeted at,Tweets,Favorites,Listed,Following,Followers,Screen name,Name
|
1372
|
-
14100886,2008-03-08 16:34:22 +0000,2012-07-07 20:33:19 +0000,6940,192,358,3427,5457,pengwynn,Wynn Netherland
|
1373
|
-
7505382,2007-07-16 12:59:01 +0000,2012-07-08 18:29:20 +0000,7890,3755,118,212,2262,sferik,Erik Michaels-Ober
|
1371
|
+
ID,Since,Last tweeted at,Tweets,Favorites,Listed,Following,Followers,Screen name,Name,Verified,Bio,Status,Location,URL
|
1372
|
+
14100886,2008-03-08 16:34:22 +0000,2012-07-07 20:33:19 +0000,6940,192,358,3427,5457,pengwynn,Wynn Netherland ⚡,false,"Christian, husband, father, GitHubber, Co-host of @thechangelog, Co-author of Sass, Compass, #CSS book http://wynn.fm/sass-meap",@akosmasoftware Sass book! @hcatlin @nex3 are the brains behind Sass. :-),"Denton, TX",http://wynnnetherland.com
|
1373
|
+
7505382,2007-07-16 12:59:01 +0000,2012-07-08 18:29:20 +0000,7890,3755,118,212,2262,sferik,Erik Michaels-Ober,false,Vagabond.,@goldman You're near my home town! Say hi to Woodstock for me.,San Francisco,https://github.com/sferik
|
1374
1374
|
eos
|
1375
1375
|
end
|
1376
1376
|
end
|
@@ -1518,9 +1518,9 @@ ID Since Last tweeted at Tweets Favorites Listed Following...
|
|
1518
1518
|
it "outputs in CSV format" do
|
1519
1519
|
@cli.leaders
|
1520
1520
|
expect($stdout.string).to eq <<-eos
|
1521
|
-
ID,Since,Last tweeted at,Tweets,Favorites,Listed,Following,Followers,Screen name,Name
|
1522
|
-
14100886,2008-03-08 16:34:22 +0000,2012-07-07 20:33:19 +0000,6940,192,358,3427,5457,pengwynn,Wynn Netherland
|
1523
|
-
7505382,2007-07-16 12:59:01 +0000,2012-07-08 18:29:20 +0000,7890,3755,118,212,2262,sferik,Erik Michaels-Ober
|
1521
|
+
ID,Since,Last tweeted at,Tweets,Favorites,Listed,Following,Followers,Screen name,Name,Verified,Bio,Status,Location,URL
|
1522
|
+
14100886,2008-03-08 16:34:22 +0000,2012-07-07 20:33:19 +0000,6940,192,358,3427,5457,pengwynn,Wynn Netherland ⚡,false,"Christian, husband, father, GitHubber, Co-host of @thechangelog, Co-author of Sass, Compass, #CSS book http://wynn.fm/sass-meap",@akosmasoftware Sass book! @hcatlin @nex3 are the brains behind Sass. :-),"Denton, TX",http://wynnnetherland.com
|
1523
|
+
7505382,2007-07-16 12:59:01 +0000,2012-07-08 18:29:20 +0000,7890,3755,118,212,2262,sferik,Erik Michaels-Ober,false,Vagabond.,@goldman You're near my home town! Say hi to Woodstock for me.,San Francisco,https://github.com/sferik
|
1524
1524
|
eos
|
1525
1525
|
end
|
1526
1526
|
end
|
@@ -2342,12 +2342,11 @@ ID 55709764298092545
|
|
2342
2342
|
Text The problem with your code is that it's doing exactly what you told it to do.
|
2343
2343
|
Screen name @sferik
|
2344
2344
|
Posted at Apr 6 2011 (8 months ago)
|
2345
|
-
Location Blowfish Sushi To Die For, 2170 Bryant St, San Francisco, California, United States
|
2346
2345
|
Retweets 320
|
2347
2346
|
Favorites 2
|
2348
2347
|
Replies 1
|
2349
2348
|
Source Twitter for iPhone
|
2350
|
-
|
2349
|
+
Location Blowfish Sushi To Die For, 2170 Bryant St, San Francisco, California, United States
|
2351
2350
|
eos
|
2352
2351
|
end
|
2353
2352
|
context "--csv" do
|
@@ -2357,8 +2356,8 @@ URL https://twitter.com/sferik/status/55709764298092545
|
|
2357
2356
|
it "has the correct output" do
|
2358
2357
|
@cli.status("55709764298092545")
|
2359
2358
|
expect($stdout.string).to eq <<-eos
|
2360
|
-
ID,
|
2361
|
-
55709764298092545,The problem with your code is that it's doing exactly what you told it to do.,
|
2359
|
+
ID,Posted at,Screen name,Text,Retweets,Favorites,Replies,Source,Location
|
2360
|
+
55709764298092545,2011-04-06 19:13:37 +0000,sferik,The problem with your code is that it's doing exactly what you told it to do.,320,2,1,Twitter for iPhone,"Blowfish Sushi To Die For, 2170 Bryant St, San Francisco, California, United States"
|
2362
2361
|
eos
|
2363
2362
|
end
|
2364
2363
|
end
|
@@ -2373,12 +2372,11 @@ ID 55709764298092550
|
|
2373
2372
|
Text The problem with your code is that it's doing exactly what you told it to do.
|
2374
2373
|
Screen name @sferik
|
2375
2374
|
Posted at Apr 6 2011 (8 months ago)
|
2376
|
-
Location Blowfish Sushi To Die For, San Francisco, California, United States
|
2377
2375
|
Retweets 320
|
2378
2376
|
Favorites 2
|
2379
2377
|
Replies 1
|
2380
2378
|
Source Twitter for iPhone
|
2381
|
-
|
2379
|
+
Location Blowfish Sushi To Die For, San Francisco, California, United States
|
2382
2380
|
eos
|
2383
2381
|
end
|
2384
2382
|
end
|
@@ -2393,12 +2391,11 @@ ID 55709764298092549
|
|
2393
2391
|
Text The problem with your code is that it's doing exactly what you told it to do.
|
2394
2392
|
Screen name @sferik
|
2395
2393
|
Posted at Apr 6 2011 (8 months ago)
|
2396
|
-
Location Blowfish Sushi To Die For, San Francisco, California, United States
|
2397
2394
|
Retweets 320
|
2398
2395
|
Favorites 2
|
2399
2396
|
Replies 1
|
2400
2397
|
Source Twitter for iPhone
|
2401
|
-
|
2398
|
+
Location Blowfish Sushi To Die For, San Francisco, California, United States
|
2402
2399
|
eos
|
2403
2400
|
end
|
2404
2401
|
end
|
@@ -2413,12 +2410,11 @@ ID 55709764298092546
|
|
2413
2410
|
Text The problem with your code is that it's doing exactly what you told it to do.
|
2414
2411
|
Screen name @sferik
|
2415
2412
|
Posted at Apr 6 2011 (8 months ago)
|
2416
|
-
Location Blowfish Sushi To Die For, San Francisco, United States
|
2417
2413
|
Retweets 320
|
2418
2414
|
Favorites 2
|
2419
2415
|
Replies 1
|
2420
2416
|
Source Twitter for iPhone
|
2421
|
-
|
2417
|
+
Location Blowfish Sushi To Die For, San Francisco, United States
|
2422
2418
|
eos
|
2423
2419
|
end
|
2424
2420
|
end
|
@@ -2433,12 +2429,11 @@ ID 55709764298092547
|
|
2433
2429
|
Text The problem with your code is that it's doing exactly what you told it to do.
|
2434
2430
|
Screen name @sferik
|
2435
2431
|
Posted at Apr 6 2011 (8 months ago)
|
2436
|
-
Location Blowfish Sushi To Die For, San Francisco
|
2437
2432
|
Retweets 320
|
2438
2433
|
Favorites 2
|
2439
2434
|
Replies 1
|
2440
2435
|
Source Twitter for iPhone
|
2441
|
-
|
2436
|
+
Location Blowfish Sushi To Die For, San Francisco
|
2442
2437
|
eos
|
2443
2438
|
end
|
2444
2439
|
end
|
@@ -2453,12 +2448,11 @@ ID 55709764298092548
|
|
2453
2448
|
Text The problem with your code is that it's doing exactly what you told it to do.
|
2454
2449
|
Screen name @sferik
|
2455
2450
|
Posted at Apr 6 2011 (8 months ago)
|
2456
|
-
Location Blowfish Sushi To Die For
|
2457
2451
|
Retweets 320
|
2458
2452
|
Favorites 2
|
2459
2453
|
Replies 1
|
2460
2454
|
Source Twitter for iPhone
|
2461
|
-
|
2455
|
+
Location Blowfish Sushi To Die For
|
2462
2456
|
eos
|
2463
2457
|
end
|
2464
2458
|
end
|
@@ -2474,12 +2468,11 @@ ID 55709764298092551
|
|
2474
2468
|
Text The problem with your code is that it's doing exactly what you told it to do.
|
2475
2469
|
Screen name @sferik
|
2476
2470
|
Posted at Apr 6 2011 (8 months ago)
|
2477
|
-
Location San Francisco, CA, USA
|
2478
2471
|
Retweets 320
|
2479
2472
|
Favorites 2
|
2480
2473
|
Replies 1
|
2481
2474
|
Source Twitter for iPhone
|
2482
|
-
|
2475
|
+
Location San Francisco, CA, USA
|
2483
2476
|
eos
|
2484
2477
|
end
|
2485
2478
|
context "with no city" do
|
@@ -2494,12 +2487,11 @@ ID 55709764298092551
|
|
2494
2487
|
Text The problem with your code is that it's doing exactly what you told it to do.
|
2495
2488
|
Screen name @sferik
|
2496
2489
|
Posted at Apr 6 2011 (8 months ago)
|
2497
|
-
Location CA, USA
|
2498
2490
|
Retweets 320
|
2499
2491
|
Favorites 2
|
2500
2492
|
Replies 1
|
2501
2493
|
Source Twitter for iPhone
|
2502
|
-
|
2494
|
+
Location CA, USA
|
2503
2495
|
eos
|
2504
2496
|
end
|
2505
2497
|
end
|
@@ -2515,16 +2507,27 @@ ID 55709764298092551
|
|
2515
2507
|
Text The problem with your code is that it's doing exactly what you told it to do.
|
2516
2508
|
Screen name @sferik
|
2517
2509
|
Posted at Apr 6 2011 (8 months ago)
|
2518
|
-
Location USA
|
2519
2510
|
Retweets 320
|
2520
2511
|
Favorites 2
|
2521
2512
|
Replies 1
|
2522
2513
|
Source Twitter for iPhone
|
2523
|
-
|
2514
|
+
Location USA
|
2524
2515
|
eos
|
2525
2516
|
end
|
2526
2517
|
end
|
2527
2518
|
end
|
2519
|
+
context "--long" do
|
2520
|
+
before do
|
2521
|
+
@cli.options = @cli.options.merge("long" => true)
|
2522
|
+
end
|
2523
|
+
it "outputs in long format" do
|
2524
|
+
@cli.status("55709764298092545")
|
2525
|
+
expect($stdout.string).to eq <<-eos
|
2526
|
+
ID Posted at Screen name Text ...
|
2527
|
+
55709764298092545 Apr 6 2011 @sferik The problem with your code is t...
|
2528
|
+
eos
|
2529
|
+
end
|
2530
|
+
end
|
2528
2531
|
end
|
2529
2532
|
|
2530
2533
|
describe "#timeline" do
|
@@ -3017,9 +3020,9 @@ WOEID Parent ID Type Name Country
|
|
3017
3020
|
it "outputs in CSV format" do
|
3018
3021
|
@cli.users("sferik", "pengwynn")
|
3019
3022
|
expect($stdout.string).to eq <<-eos
|
3020
|
-
ID,Since,Last tweeted at,Tweets,Favorites,Listed,Following,Followers,Screen name,Name
|
3021
|
-
14100886,2008-03-08 16:34:22 +0000,2012-07-07 20:33:19 +0000,6940,192,358,3427,5457,pengwynn,Wynn Netherland
|
3022
|
-
7505382,2007-07-16 12:59:01 +0000,2012-07-08 18:29:20 +0000,7890,3755,118,212,2262,sferik,Erik Michaels-Ober
|
3023
|
+
ID,Since,Last tweeted at,Tweets,Favorites,Listed,Following,Followers,Screen name,Name,Verified,Bio,Status,Location,URL
|
3024
|
+
14100886,2008-03-08 16:34:22 +0000,2012-07-07 20:33:19 +0000,6940,192,358,3427,5457,pengwynn,Wynn Netherland ⚡,false,"Christian, husband, father, GitHubber, Co-host of @thechangelog, Co-author of Sass, Compass, #CSS book http://wynn.fm/sass-meap",@akosmasoftware Sass book! @hcatlin @nex3 are the brains behind Sass. :-),"Denton, TX",http://wynnnetherland.com
|
3025
|
+
7505382,2007-07-16 12:59:01 +0000,2012-07-08 18:29:20 +0000,7890,3755,118,212,2262,sferik,Erik Michaels-Ober,false,Vagabond.,@goldman You're near my home town! Say hi to Woodstock for me.,San Francisco,https://github.com/sferik
|
3023
3026
|
eos
|
3024
3027
|
end
|
3025
3028
|
end
|
@@ -3148,17 +3151,17 @@ ID Since Last tweeted at Tweets Favorites Listed Following...
|
|
3148
3151
|
@cli.whois("sferik")
|
3149
3152
|
expect($stdout.string).to eq <<-eos
|
3150
3153
|
ID 7505382
|
3151
|
-
Name Erik Michaels-Ober
|
3152
|
-
Bio Vagabond.
|
3153
|
-
Location San Francisco
|
3154
|
-
Status Not following
|
3155
|
-
Last update @goldman You're near my home town! Say hi to Woodstock for me. (7 months ago)
|
3156
3154
|
Since Jul 16 2007 (4 years ago)
|
3155
|
+
Last update @goldman You're near my home town! Say hi to Woodstock for me. (7 months ago)
|
3156
|
+
Screen name @sferik
|
3157
|
+
Name Erik Michaels-Ober
|
3157
3158
|
Tweets 7,890
|
3158
3159
|
Favorites 3,755
|
3159
3160
|
Listed 118
|
3160
3161
|
Following 212
|
3161
3162
|
Followers 2,262
|
3163
|
+
Bio Vagabond.
|
3164
|
+
Location San Francisco
|
3162
3165
|
URL https://github.com/sferik
|
3163
3166
|
eos
|
3164
3167
|
end
|
@@ -3169,8 +3172,8 @@ URL https://github.com/sferik
|
|
3169
3172
|
it "has the correct output" do
|
3170
3173
|
@cli.whois("sferik")
|
3171
3174
|
expect($stdout.string).to eq <<-eos
|
3172
|
-
ID,
|
3173
|
-
7505382,
|
3175
|
+
ID,Since,Last tweeted at,Tweets,Favorites,Listed,Following,Followers,Screen name,Name,Verified,Bio,Status,Location,URL
|
3176
|
+
7505382,2007-07-16 12:59:01 +0000,2012-07-08 18:29:20 +0000,7890,3755,118,212,2262,sferik,Erik Michaels-Ober,false,Vagabond.,@goldman You're near my home town! Say hi to Woodstock for me.,San Francisco,https://github.com/sferik
|
3174
3177
|
eos
|
3175
3178
|
end
|
3176
3179
|
end
|
@@ -3184,6 +3187,18 @@ ID,Verified,Name,Screen name,Bio,Location,Following,Last update,Lasted updated a
|
|
3184
3187
|
expect(a_get("/1.1/users/show.json").with(:query => {:user_id => "7505382"})).to have_been_made
|
3185
3188
|
end
|
3186
3189
|
end
|
3190
|
+
context "--long" do
|
3191
|
+
before do
|
3192
|
+
@cli.options = @cli.options.merge("long" => true)
|
3193
|
+
end
|
3194
|
+
it "outputs in long format" do
|
3195
|
+
@cli.whois("sferik")
|
3196
|
+
expect($stdout.string).to eq <<-eos
|
3197
|
+
ID Since Last tweeted at Tweets Favorites Listed Following ...
|
3198
|
+
7505382 Jul 16 2007 Jul 8 10:29 7890 3755 118 212 ...
|
3199
|
+
eos
|
3200
|
+
end
|
3201
|
+
end
|
3187
3202
|
end
|
3188
3203
|
|
3189
3204
|
end
|
data/spec/list_spec.rb
CHANGED
@@ -153,9 +153,9 @@ ID,Description,Slug,Screen name,Created at,Members,Subscribers,Following,Mode,UR
|
|
153
153
|
it "outputs in CSV format" do
|
154
154
|
@list.members("presidents")
|
155
155
|
expect($stdout.string).to eq <<-eos
|
156
|
-
ID,Since,Last tweeted at,Tweets,Favorites,Listed,Following,Followers,Screen name,Name
|
157
|
-
14100886,2008-03-08 16:34:22 +0000,2012-07-07 20:33:19 +0000,6940,192,358,3427,5457,pengwynn,Wynn Netherland
|
158
|
-
7505382,2007-07-16 12:59:01 +0000,2012-07-08 18:29:20 +0000,7890,3755,118,212,2262,sferik,Erik Michaels-Ober
|
156
|
+
ID,Since,Last tweeted at,Tweets,Favorites,Listed,Following,Followers,Screen name,Name,Verified,Bio,Status,Location,URL
|
157
|
+
14100886,2008-03-08 16:34:22 +0000,2012-07-07 20:33:19 +0000,6940,192,358,3427,5457,pengwynn,Wynn Netherland ⚡,false,"Christian, husband, father, GitHubber, Co-host of @thechangelog, Co-author of Sass, Compass, #CSS book http://wynn.fm/sass-meap",@akosmasoftware Sass book! @hcatlin @nex3 are the brains behind Sass. :-),"Denton, TX",http://wynnnetherland.com
|
158
|
+
7505382,2007-07-16 12:59:01 +0000,2012-07-08 18:29:20 +0000,7890,3755,118,212,2262,sferik,Erik Michaels-Ober,false,Vagabond.,@goldman You're near my home town! Say hi to Woodstock for me.,San Francisco,https://github.com/sferik
|
159
159
|
eos
|
160
160
|
end
|
161
161
|
end
|
data/spec/search_spec.rb
CHANGED
@@ -1279,9 +1279,9 @@ ID Posted at Screen name Text
|
|
1279
1279
|
it "outputs in CSV format" do
|
1280
1280
|
@search.users("Erik")
|
1281
1281
|
expect($stdout.string).to eq <<-eos
|
1282
|
-
ID,Since,Last tweeted at,Tweets,Favorites,Listed,Following,Followers,Screen name,Name
|
1283
|
-
14100886,2008-03-08 16:34:22 +0000,2012-07-07 20:33:19 +0000,6940,192,358,3427,5457,pengwynn,Wynn Netherland
|
1284
|
-
7505382,2007-07-16 12:59:01 +0000,2012-07-08 18:29:20 +0000,7890,3755,118,212,2262,sferik,Erik Michaels-Ober
|
1282
|
+
ID,Since,Last tweeted at,Tweets,Favorites,Listed,Following,Followers,Screen name,Name,Verified,Bio,Status,Location,URL
|
1283
|
+
14100886,2008-03-08 16:34:22 +0000,2012-07-07 20:33:19 +0000,6940,192,358,3427,5457,pengwynn,Wynn Netherland ⚡,false,"Christian, husband, father, GitHubber, Co-host of @thechangelog, Co-author of Sass, Compass, #CSS book http://wynn.fm/sass-meap",@akosmasoftware Sass book! @hcatlin @nex3 are the brains behind Sass. :-),"Denton, TX",http://wynnnetherland.com
|
1284
|
+
7505382,2007-07-16 12:59:01 +0000,2012-07-08 18:29:20 +0000,7890,3755,118,212,2262,sferik,Erik Michaels-Ober,false,Vagabond.,@goldman You're near my home town! Say hi to Woodstock for me.,San Francisco,https://github.com/sferik
|
1285
1285
|
eos
|
1286
1286
|
end
|
1287
1287
|
end
|
data/t.gemspec
CHANGED
@@ -13,12 +13,8 @@ Gem::Specification.new do |spec|
|
|
13
13
|
spec.add_dependency 'tweetstream', '~> 2.3'
|
14
14
|
spec.add_dependency 'twitter', '~> 4.4'
|
15
15
|
spec.add_development_dependency 'pry'
|
16
|
-
spec.add_development_dependency 'pry-
|
17
|
-
spec.add_development_dependency 'rake'
|
18
|
-
spec.add_development_dependency 'rspec'
|
16
|
+
spec.add_development_dependency 'pry-debugger'
|
19
17
|
spec.add_development_dependency 'simplecov'
|
20
|
-
spec.add_development_dependency 'timecop'
|
21
|
-
spec.add_development_dependency 'webmock'
|
22
18
|
spec.author = "Erik Michaels-Ober"
|
23
19
|
spec.bindir = 'bin'
|
24
20
|
spec.description = %q{A command-line power tool for Twitter.}
|
metadata
CHANGED
@@ -2,14 +2,14 @@
|
|
2
2
|
name: t
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 1.
|
5
|
+
version: 1.6.0
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Erik Michaels-Ober
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-12-
|
12
|
+
date: 2012-12-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -200,39 +200,7 @@ dependencies:
|
|
200
200
|
- !ruby/object:Gem::Version
|
201
201
|
version: '0'
|
202
202
|
none: false
|
203
|
-
name: pry-
|
204
|
-
type: :development
|
205
|
-
prerelease: false
|
206
|
-
requirement: !ruby/object:Gem::Requirement
|
207
|
-
requirements:
|
208
|
-
- - ! '>='
|
209
|
-
- !ruby/object:Gem::Version
|
210
|
-
version: '0'
|
211
|
-
none: false
|
212
|
-
- !ruby/object:Gem::Dependency
|
213
|
-
version_requirements: !ruby/object:Gem::Requirement
|
214
|
-
requirements:
|
215
|
-
- - ! '>='
|
216
|
-
- !ruby/object:Gem::Version
|
217
|
-
version: '0'
|
218
|
-
none: false
|
219
|
-
name: rake
|
220
|
-
type: :development
|
221
|
-
prerelease: false
|
222
|
-
requirement: !ruby/object:Gem::Requirement
|
223
|
-
requirements:
|
224
|
-
- - ! '>='
|
225
|
-
- !ruby/object:Gem::Version
|
226
|
-
version: '0'
|
227
|
-
none: false
|
228
|
-
- !ruby/object:Gem::Dependency
|
229
|
-
version_requirements: !ruby/object:Gem::Requirement
|
230
|
-
requirements:
|
231
|
-
- - ! '>='
|
232
|
-
- !ruby/object:Gem::Version
|
233
|
-
version: '0'
|
234
|
-
none: false
|
235
|
-
name: rspec
|
203
|
+
name: pry-debugger
|
236
204
|
type: :development
|
237
205
|
prerelease: false
|
238
206
|
requirement: !ruby/object:Gem::Requirement
|
@@ -257,38 +225,6 @@ dependencies:
|
|
257
225
|
- !ruby/object:Gem::Version
|
258
226
|
version: '0'
|
259
227
|
none: false
|
260
|
-
- !ruby/object:Gem::Dependency
|
261
|
-
version_requirements: !ruby/object:Gem::Requirement
|
262
|
-
requirements:
|
263
|
-
- - ! '>='
|
264
|
-
- !ruby/object:Gem::Version
|
265
|
-
version: '0'
|
266
|
-
none: false
|
267
|
-
name: timecop
|
268
|
-
type: :development
|
269
|
-
prerelease: false
|
270
|
-
requirement: !ruby/object:Gem::Requirement
|
271
|
-
requirements:
|
272
|
-
- - ! '>='
|
273
|
-
- !ruby/object:Gem::Version
|
274
|
-
version: '0'
|
275
|
-
none: false
|
276
|
-
- !ruby/object:Gem::Dependency
|
277
|
-
version_requirements: !ruby/object:Gem::Requirement
|
278
|
-
requirements:
|
279
|
-
- - ! '>='
|
280
|
-
- !ruby/object:Gem::Version
|
281
|
-
version: '0'
|
282
|
-
none: false
|
283
|
-
name: webmock
|
284
|
-
type: :development
|
285
|
-
prerelease: false
|
286
|
-
requirement: !ruby/object:Gem::Requirement
|
287
|
-
requirements:
|
288
|
-
- - ! '>='
|
289
|
-
- !ruby/object:Gem::Version
|
290
|
-
version: '0'
|
291
|
-
none: false
|
292
228
|
description: A command-line power tool for Twitter.
|
293
229
|
email: sferik@gmail.com
|
294
230
|
executables:
|