t 0.0.1 → 0.0.2
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/.travis.yml +1 -2
- data/README.md +41 -37
- data/lib/t/cli.rb +9 -6
- data/lib/t/set.rb +2 -1
- data/lib/t/version.rb +1 -1
- data/spec/rcfile_spec.rb +1 -1
- data/t.gemspec +2 -1
- metadata +37 -23
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -6,7 +6,7 @@ however it offers more commands than are available via SMS.
|
|
6
6
|
[gem]: https://rubygems.org/gems/twitter
|
7
7
|
[sms]: https://support.twitter.com/articles/14020-twitter-sms-command
|
8
8
|
|
9
|
-
## <a name="history">History
|
9
|
+
## <a name="history"></a>History
|
10
10
|

|
11
11
|
|
12
12
|
The [twitter gem][gem] previously contained a command-line interface, up until
|
@@ -16,21 +16,26 @@ John Nunemaker's original code.
|
|
16
16
|
|
17
17
|
[removed]: https://github.com/jnunemaker/twitter/commit/dd2445e3e2c97f38b28a3f32ea902536b3897adf
|
18
18
|
|
19
|
-
## <a name="installation">Installation
|
19
|
+
## <a name="installation"></a>Installation
|
20
20
|
gem install t
|
21
21
|
|
22
|
-
## <a name="ci">Continuous Integration
|
23
|
-
[][
|
22
|
+
## <a name="ci"></a>Continuous Integration
|
23
|
+
[][ci]
|
24
24
|
|
25
|
-
[
|
25
|
+
[ci]: http://travis-ci.org/sferik/t
|
26
26
|
|
27
|
-
## <a name="
|
27
|
+
## <a name="dependencies"></a>Dependency Status
|
28
|
+
[][gemnasium]
|
29
|
+
|
30
|
+
[gemnasium]: https://gemnasium.com/codeforamerica/adopt-a-hydrant
|
31
|
+
|
32
|
+
## <a name="examples"></a>Usage Examples
|
28
33
|
Typing `t help` will give you a list of all the available commands. You can
|
29
34
|
type `t help TASK` to get help for a specific command.
|
30
35
|
|
31
36
|
t help
|
32
37
|
|
33
|
-
Because Twitter requires OAuth for most of
|
38
|
+
Because Twitter requires OAuth for most of its functionality, you'll need to
|
34
39
|
register a new application at <http://dev.twitter.com/apps/new>. Once you
|
35
40
|
create your application make sure to set the "Application Type" to "Read, Write
|
36
41
|
and Access direct messages", otherwise you won't be able to post status updates
|
@@ -53,63 +58,63 @@ You can easily switch between accounts.
|
|
53
58
|
|
54
59
|
Incidentally, account information is stored in YAML format in `~/.trc`.
|
55
60
|
|
56
|
-
### <a name="update">Update your status
|
61
|
+
### <a name="update"></a>Update your status
|
57
62
|
|
58
63
|
t update "I'm tweeting from the command line, powered by @gem."
|
59
64
|
|
60
|
-
### <a name="dm">Send a user a private message
|
65
|
+
### <a name="dm"></a>Send a user a private message
|
61
66
|
|
62
67
|
t dm sferik "Want to get dinner together tonight?"
|
63
68
|
|
64
|
-
### <a name="location">Update the location field in your profile
|
69
|
+
### <a name="location"></a>Update the location field in your profile
|
65
70
|
|
66
71
|
t set location San Francisco
|
67
72
|
|
68
|
-
### <a name="get">Retrieve the latest Tweet posted by a user
|
73
|
+
### <a name="get"></a>Retrieve the latest Tweet posted by a user
|
69
74
|
|
70
75
|
t get sferik
|
71
76
|
|
72
|
-
### <a name="whois">Retrieve profile information for a user
|
77
|
+
### <a name="whois"></a>Retrieve profile information for a user
|
73
78
|
|
74
79
|
t whois sferik
|
75
80
|
|
76
|
-
### <a name="stats">Get stats about a user
|
81
|
+
### <a name="stats"></a>Get stats about a user
|
77
82
|
|
78
83
|
t stats sferik
|
79
84
|
|
80
|
-
### <a name="suggest">Return a listing of users you might enjoy following
|
85
|
+
### <a name="suggest"></a>Return a listing of users you might enjoy following
|
81
86
|
|
82
87
|
t suggest
|
83
88
|
|
84
|
-
### <a name="follow">Start following a user
|
89
|
+
### <a name="follow"></a>Start following a user
|
85
90
|
|
86
91
|
t follow sferik
|
87
92
|
|
88
|
-
### <a name="leave">Stop following a user
|
93
|
+
### <a name="leave"></a>Stop following a user
|
89
94
|
|
90
95
|
t unfollow sferik
|
91
96
|
|
92
|
-
### <a name="timeline">Retrieve the timeline of status updates from users you are following
|
97
|
+
### <a name="timeline"></a>Retrieve the timeline of status updates from users you are following
|
93
98
|
|
94
99
|
t timeline
|
95
100
|
|
96
|
-
### <a name="mentions">Retrieve the timeline of status updates that mention you
|
101
|
+
### <a name="mentions"></a>Retrieve the timeline of status updates that mention you
|
97
102
|
|
98
103
|
t mentions
|
99
104
|
|
100
|
-
### <a name="reply">Reply to a Tweet
|
105
|
+
### <a name="reply"></a>Reply to a Tweet
|
101
106
|
|
102
107
|
t reply sferik Thanks
|
103
108
|
|
104
|
-
### <a name="retweet">Send another user's latest Tweet to your followers
|
109
|
+
### <a name="retweet"></a>Send another user's latest Tweet to your followers
|
105
110
|
|
106
111
|
t retweet sferik
|
107
112
|
|
108
|
-
### <a name="favorite">Mark a user's latest Tweet as one of your favorites
|
113
|
+
### <a name="favorite"></a>Mark a user's latest Tweet as one of your favorites
|
109
114
|
|
110
115
|
t favorite sferik
|
111
116
|
|
112
|
-
## <a name="contributing">Contributing
|
117
|
+
## <a name="contributing"></a>Contributing
|
113
118
|
In the spirit of [free software][fsf], **everyone** is encouraged to help
|
114
119
|
improve this project.
|
115
120
|
|
@@ -127,22 +132,21 @@ Here are some ways *you* can contribute:
|
|
127
132
|
* by refactoring code
|
128
133
|
* by closing [issues][]
|
129
134
|
* by reviewing patches
|
130
|
-
* by financially (please send bitcoin donations to
|
131
|
-
1KxSo9bGBfPVFEtWNLpnUK1bfLNNT4q31L)
|
132
135
|
|
133
136
|
[issues]: https://github.com/sferik/t/issues
|
134
137
|
|
135
|
-
## <a name="issues">Submitting an Issue
|
138
|
+
## <a name="issues"></a>Submitting an Issue
|
136
139
|
We use the [GitHub issue tracker][issues] to track bugs and features. Before
|
137
140
|
submitting a bug report or feature request, check to make sure it hasn't
|
138
|
-
already been submitted. You can indicate support for an existing
|
139
|
-
voting it up. When submitting a bug report, please include a
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
141
|
+
already been submitted. You can indicate support for an existing issue by
|
142
|
+
voting it up. When submitting a bug report, please include a [Gist][] that
|
143
|
+
includes a stack trace and any details that may be necessary to reproduce the
|
144
|
+
bug, including your gem version, Ruby version, and operating system. Ideally, a
|
145
|
+
bug report should include a pull request with failing specs.
|
146
|
+
|
147
|
+
[gist]: https://gist.github.com/
|
148
|
+
|
149
|
+
## <a name="pulls"></a>Submitting a Pull Request
|
146
150
|
1. Fork the project.
|
147
151
|
2. Create a topic branch.
|
148
152
|
3. Implement your feature or bug fix.
|
@@ -157,13 +161,13 @@ request with failing specs.
|
|
157
161
|
version, or history file. (If you want to create your own version for some
|
158
162
|
reason, please do so in a separate commit.)
|
159
163
|
|
160
|
-
## <a name="
|
161
|
-
This library aims to support and is [tested against][
|
164
|
+
## <a name="versions"></a>Supported Ruby Versions
|
165
|
+
This library aims to support and is [tested against][ci] the following Ruby
|
162
166
|
implementations:
|
163
167
|
|
164
168
|
* Ruby 1.8.7
|
165
|
-
* Ruby 1.9.1
|
166
169
|
* Ruby 1.9.2
|
170
|
+
* Ruby 1.9.3
|
167
171
|
* [JRuby][]
|
168
172
|
* [Rubinius][]
|
169
173
|
* [Ruby Enterprise Edition][ree]
|
@@ -186,7 +190,7 @@ implementation, you will be personally responsible for providing patches in a
|
|
186
190
|
timely fashion. If critical issues for a particular implementation exist at the
|
187
191
|
time of a major release, support for that Ruby version may be dropped.
|
188
192
|
|
189
|
-
## <a name="copyright">Copyright
|
193
|
+
## <a name="copyright"></a>Copyright
|
190
194
|
Copyright (c) 2011 Erik Michaels-Ober. See [LICENSE][] for details.
|
191
195
|
|
192
196
|
[license]: https://github.com/sferik/t/blob/master/LICENSE.md
|
data/lib/t/cli.rb
CHANGED
@@ -102,13 +102,12 @@ module T
|
|
102
102
|
desc "favorite USERNAME", "Marks that user's last Tweet as one of your favorites."
|
103
103
|
def favorite(username)
|
104
104
|
status = client.user_timeline(username).first
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
say "You have already favorited this status."
|
110
|
-
end
|
105
|
+
client.favorite(status.id)
|
106
|
+
say "You have favorited @#{username}'s latest tweet: #{status.text}"
|
107
|
+
rescue Twitter::Error::Forbidden => error
|
108
|
+
say error.message
|
111
109
|
end
|
110
|
+
map :fave => :favorite
|
112
111
|
|
113
112
|
desc "follow USERNAME", "Allows you to start following a specific user."
|
114
113
|
def follow(username)
|
@@ -149,6 +148,8 @@ module T
|
|
149
148
|
in_reply_to_status = client.user_timeline(username).first
|
150
149
|
status = client.update("@#{username} #{message}", :in_reply_to_status_id => in_reply_to_status.id)
|
151
150
|
say "Reply created (#{time_ago_in_words(status.created_at)} ago)"
|
151
|
+
rescue Twitter::Error::Forbidden => error
|
152
|
+
say error.message
|
152
153
|
end
|
153
154
|
|
154
155
|
desc "retweet USERNAME", "Sends that user's latest Tweet to your followers."
|
@@ -215,6 +216,8 @@ module T
|
|
215
216
|
def update(message)
|
216
217
|
status = client.update(message)
|
217
218
|
say "Tweet created (#{time_ago_in_words(status.created_at)} ago)"
|
219
|
+
rescue Twitter::Error::Forbidden => error
|
220
|
+
say error.message
|
218
221
|
end
|
219
222
|
map :post => :update
|
220
223
|
|
data/lib/t/set.rb
CHANGED
@@ -14,8 +14,9 @@ module T
|
|
14
14
|
end
|
15
15
|
|
16
16
|
desc "default USERNAME, CONSUMER_KEY", "Set your default account."
|
17
|
-
def default(username, consumer_key)
|
17
|
+
def default(username, consumer_key=nil)
|
18
18
|
rcfile = RCFile.instance
|
19
|
+
consumer_key = rcfile[username].keys.last if consumer_key.nil?
|
19
20
|
rcfile.default_profile = {'username' => username, 'consumer_key' => consumer_key}
|
20
21
|
say "Default account has been changed."
|
21
22
|
end
|
data/lib/t/version.rb
CHANGED
data/spec/rcfile_spec.rb
CHANGED
@@ -10,7 +10,7 @@ describe RCFile do
|
|
10
10
|
RCFile.should be_a Class
|
11
11
|
lambda do
|
12
12
|
RCFile.new
|
13
|
-
end.should raise_error(NoMethodError,
|
13
|
+
end.should raise_error(NoMethodError, /private method `new' called/)
|
14
14
|
end
|
15
15
|
|
16
16
|
describe '#[]' do
|
data/t.gemspec
CHANGED
@@ -5,8 +5,9 @@ Gem::Specification.new do |gem|
|
|
5
5
|
gem.add_dependency 'actionpack', '~> 3.1'
|
6
6
|
gem.add_dependency 'launchy', '~> 2.0'
|
7
7
|
gem.add_dependency 'thor', '~> 0.15.0.rc2'
|
8
|
-
gem.add_dependency 'twitter', '~> 2.0'
|
8
|
+
gem.add_dependency 'twitter', ['~> 2.0', '>= 2.0.1']
|
9
9
|
gem.add_dependency 'oauth', '~> 0.4'
|
10
|
+
gem.add_dependency 'yajl-ruby', '~> 1.1'
|
10
11
|
gem.add_development_dependency 'pry'
|
11
12
|
gem.add_development_dependency 'rake'
|
12
13
|
gem.add_development_dependency 'rspec'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: t
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-
|
12
|
+
date: 2011-12-02 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: actionpack
|
16
|
-
requirement: &
|
16
|
+
requirement: &70224079379220 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '3.1'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70224079379220
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: launchy
|
27
|
-
requirement: &
|
27
|
+
requirement: &70224079377600 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '2.0'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70224079377600
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: thor
|
38
|
-
requirement: &
|
38
|
+
requirement: &70224079376940 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
@@ -43,21 +43,24 @@ dependencies:
|
|
43
43
|
version: 0.15.0.rc2
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70224079376940
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: twitter
|
49
|
-
requirement: &
|
49
|
+
requirement: &70224079375980 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ~>
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '2.0'
|
55
|
+
- - ! '>='
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
version: 2.0.1
|
55
58
|
type: :runtime
|
56
59
|
prerelease: false
|
57
|
-
version_requirements: *
|
60
|
+
version_requirements: *70224079375980
|
58
61
|
- !ruby/object:Gem::Dependency
|
59
62
|
name: oauth
|
60
|
-
requirement: &
|
63
|
+
requirement: &70224079374920 !ruby/object:Gem::Requirement
|
61
64
|
none: false
|
62
65
|
requirements:
|
63
66
|
- - ~>
|
@@ -65,10 +68,21 @@ dependencies:
|
|
65
68
|
version: '0.4'
|
66
69
|
type: :runtime
|
67
70
|
prerelease: false
|
68
|
-
version_requirements: *
|
71
|
+
version_requirements: *70224079374920
|
72
|
+
- !ruby/object:Gem::Dependency
|
73
|
+
name: yajl-ruby
|
74
|
+
requirement: &70224079372960 !ruby/object:Gem::Requirement
|
75
|
+
none: false
|
76
|
+
requirements:
|
77
|
+
- - ~>
|
78
|
+
- !ruby/object:Gem::Version
|
79
|
+
version: '1.1'
|
80
|
+
type: :runtime
|
81
|
+
prerelease: false
|
82
|
+
version_requirements: *70224079372960
|
69
83
|
- !ruby/object:Gem::Dependency
|
70
84
|
name: pry
|
71
|
-
requirement: &
|
85
|
+
requirement: &70224079372080 !ruby/object:Gem::Requirement
|
72
86
|
none: false
|
73
87
|
requirements:
|
74
88
|
- - ! '>='
|
@@ -76,10 +90,10 @@ dependencies:
|
|
76
90
|
version: '0'
|
77
91
|
type: :development
|
78
92
|
prerelease: false
|
79
|
-
version_requirements: *
|
93
|
+
version_requirements: *70224079372080
|
80
94
|
- !ruby/object:Gem::Dependency
|
81
95
|
name: rake
|
82
|
-
requirement: &
|
96
|
+
requirement: &70224079371020 !ruby/object:Gem::Requirement
|
83
97
|
none: false
|
84
98
|
requirements:
|
85
99
|
- - ! '>='
|
@@ -87,10 +101,10 @@ dependencies:
|
|
87
101
|
version: '0'
|
88
102
|
type: :development
|
89
103
|
prerelease: false
|
90
|
-
version_requirements: *
|
104
|
+
version_requirements: *70224079371020
|
91
105
|
- !ruby/object:Gem::Dependency
|
92
106
|
name: rspec
|
93
|
-
requirement: &
|
107
|
+
requirement: &70224079369980 !ruby/object:Gem::Requirement
|
94
108
|
none: false
|
95
109
|
requirements:
|
96
110
|
- - ! '>='
|
@@ -98,10 +112,10 @@ dependencies:
|
|
98
112
|
version: '0'
|
99
113
|
type: :development
|
100
114
|
prerelease: false
|
101
|
-
version_requirements: *
|
115
|
+
version_requirements: *70224079369980
|
102
116
|
- !ruby/object:Gem::Dependency
|
103
117
|
name: simplecov
|
104
|
-
requirement: &
|
118
|
+
requirement: &70224079368880 !ruby/object:Gem::Requirement
|
105
119
|
none: false
|
106
120
|
requirements:
|
107
121
|
- - ! '>='
|
@@ -109,10 +123,10 @@ dependencies:
|
|
109
123
|
version: '0'
|
110
124
|
type: :development
|
111
125
|
prerelease: false
|
112
|
-
version_requirements: *
|
126
|
+
version_requirements: *70224079368880
|
113
127
|
- !ruby/object:Gem::Dependency
|
114
128
|
name: webmock
|
115
|
-
requirement: &
|
129
|
+
requirement: &70224079367720 !ruby/object:Gem::Requirement
|
116
130
|
none: false
|
117
131
|
requirements:
|
118
132
|
- - ! '>='
|
@@ -120,7 +134,7 @@ dependencies:
|
|
120
134
|
version: '0'
|
121
135
|
type: :development
|
122
136
|
prerelease: false
|
123
|
-
version_requirements: *
|
137
|
+
version_requirements: *70224079367720
|
124
138
|
description: A command-line interface for Twitter.
|
125
139
|
email: sferik@gmail.com
|
126
140
|
executables:
|
@@ -165,7 +179,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
165
179
|
version: 1.3.6
|
166
180
|
requirements: []
|
167
181
|
rubyforge_project:
|
168
|
-
rubygems_version: 1.8.
|
182
|
+
rubygems_version: 1.8.10
|
169
183
|
signing_key:
|
170
184
|
specification_version: 3
|
171
185
|
summary: CLI for Twitter
|