Skip to content
This repository
Newer
Older
100644 327 lines (235 sloc) 12.874 kb
75c72d50 »
2012-05-09 Clean up #40
1 # [![Application icon](https://github.com/sferik/t/raw/master/icon/t.png)][icon]
428d4728 »
2012-05-09 updated with icon on the top and attribuition at the bottom
2
75c72d50 »
2012-05-09 Clean up #40
3 [icon]: https://github.com/sferik/t/raw/master/icon/t.png
4
2c4c640d »
2012-05-27 More comprehensive installation instructions
5 # Twitter CLI
6 [![Build Status](https://secure.travis-ci.org/sferik/t.png?branch=master)][travis]
7 [![Dependency Status](https://gemnasium.com/sferik/t.png?travis)][gemnasium]
8 [![Click here to make a donation to T](http://www.pledgie.com/campaigns/17330.png)][pledgie]
428d4728 »
2012-05-09 updated with icon on the top and attribuition at the bottom
9
d9ff8746 »
2012-03-29 Update description
10 ### A command-line power tool for Twitter.
11
4e4ce920 »
2012-04-29 README updates
12 The CLI takes syntactic cues from the [Twitter SMS commands][sms], however it
13 offers vastly more commands and capabilities than are available via SMS.
8f54d11c »
2011-11-22 Initial commit
14
48dbd537 »
2011-12-16 Update README
15 [travis]: http://travis-ci.org/sferik/t
16 [gemnasium]: https://gemnasium.com/sferik/t
6a699033 »
2012-05-07 Add Pledgie campaign link
17 [pledgie]: http://www.pledgie.com/campaigns/17330
8f54d11c »
2011-11-22 Initial commit
18 [sms]: https://support.twitter.com/articles/14020-twitter-sms-command
19
4991875f »
2012-04-29 Remove anchors since they are now inserted by GitHub automatically!
20 ## Installation
2c4c640d »
2012-05-27 More comprehensive installation instructions
21
22 First, make sure you have Ruby installed.
23
53e0254c »
2012-06-22 Minor formatting tweaks
24 **On a Mac**, open `/Applications/Utilities/Terminal.app` and type:
2c4c640d »
2012-05-27 More comprehensive installation instructions
25
26 ruby -v
27
28 If the output looks something like this, you're in good shape:
29
30 ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-darwin12.0.0]
31
32 If the output looks more like this, you need to [install Ruby][ruby]:
33
34 ruby: command not found
35
36 **On Windows**, you can install Ruby with [RubyInstaller][].
37
b4e513b5 »
2012-07-08 Change sort flag to enum
38 Once you've verified that Ruby is installed:
2c4c640d »
2012-05-27 More comprehensive installation instructions
39
40 gem install t
41
42 [ruby]: http://www.ruby-lang.org/en/downloads/
43 [rubyinstaller]: http://rubyinstaller.org/
8f54d11c »
2011-11-22 Initial commit
44
4991875f »
2012-04-29 Remove anchors since they are now inserted by GitHub automatically!
45 ## Configuration
8f54d11c »
2011-11-22 Initial commit
46
cedc67d4 »
2012-09-16 s/most/all/ :disappointed:
47 Twitter API v1.1 requires OAuth for all of its functionality, so you'll need a
915251f8 »
2012-05-27 Update auth instructions
48 registered Twitter application. If you've never registered a Twitter
49 application before, it's easy! Just sign-in using your Twitter account and the
50 fill out the short form at <http://dev.twitter.com/apps/new>. If you've
51 previously registered a Twitter application, it should be listed at
52 <http://dev.twitter.com/apps>. Once you've registered an application, make sure
53 to set your application's Access Level to "Read, Write and Access direct
54 messages", otherwise you'll receive an error that looks like this:
8f54d11c »
2011-11-22 Initial commit
55
4e4ce920 »
2012-04-29 README updates
56 Read-only application cannot POST
57
915251f8 »
2012-05-27 Update auth instructions
58 Now, you're ready to authorize a Twitter account with your application. To
59 proceed, type the following command at the prompt and follow the instructions:
8f54d11c »
2011-11-22 Initial commit
60
915251f8 »
2012-05-27 Update auth instructions
61 t authorize
8f54d11c »
2011-11-22 Initial commit
62
915251f8 »
2012-05-27 Update auth instructions
63 This command will direct you to a URL where you can sign-in to Twitter,
64 authorize the application, and then enter the returned PIN back into the
65 terminal. If you type the PIN correctly, you should now be authorized to use
66 `t` as that user. To authorize multiple accounts, simply repeat the last step,
67 signing into Twitter as a different user.
8f54d11c »
2011-11-22 Initial commit
68
4e4ce920 »
2012-04-29 README updates
69 You can see a list of all the accounts you've authorized by typing the command:
8f54d11c »
2011-11-22 Initial commit
70
71 t accounts
72
4e4ce920 »
2012-04-29 README updates
73 The output of which will be structured like this:
74
bfcef3bf »
2011-12-02 Clarify text
75 sferik
76 UDfNTpOz5ZDG4a6w7dIWj
77 uuP7Xbl2mEfGMiDu1uIyFN
78 gem
d4375f16 »
2012-04-27 Rename default profile to active profile
79 thG9EfWoADtIr6NjbL9ON (active)
8f54d11c »
2011-11-22 Initial commit
80
52a1c4ca »
2012-05-01 Show last 20 results before starting to stream
81 **Note**: One of your authorized accounts (specifically, the last one
82 authorized) will be set as active. To change the active account, use the `set`
e2897372 »
2012-05-01 Fix typo
83 subcommand, passing either just a username, if it's unambiguous, or a username
84 and consumer key pair, like this:
8f54d11c »
2011-11-22 Initial commit
85
d4375f16 »
2012-04-27 Rename default profile to active profile
86 t set active sferik UDfNTpOz5ZDG4a6w7dIWj
bfcef3bf »
2011-12-02 Clarify text
87
4e4ce920 »
2012-04-29 README updates
88 Account information is stored in a YAML-formatted file located at `~/.trc`.
e2897372 »
2012-05-01 Fix typo
89
4e414502 »
2012-05-11 Diction
90 **Note**: Anyone with access to this file can impersonate you on Twitter, so
4e4ce920 »
2012-04-29 README updates
91 it's important to keep it secure, just as you would treat your SSH private key.
52a1c4ca »
2012-05-01 Show last 20 results before starting to stream
92 For this reason, the file is hidden and has the permission bits set to `0600`.
8f54d11c »
2011-11-22 Initial commit
93
4991875f »
2012-04-29 Remove anchors since they are now inserted by GitHub automatically!
94 ## Usage Examples
4e4ce920 »
2012-04-29 README updates
95 Typing `t help` will list all the available commands. You can type `t help
96 TASK` to get help for a specific command.
48dbd537 »
2011-12-16 Update README
97
98 t help
99
4991875f »
2012-04-29 Remove anchors since they are now inserted by GitHub automatically!
100 ### Update your status
e8f509a1 »
2011-12-09 More interesting example tweet [ci skip]
101 t update "I'm tweeting from the command line. Isn't that special?"
8f54d11c »
2011-11-22 Initial commit
102
8fbd6edf »
2012-04-24 Add Features section
103 **Note**: If your tweet includes special characters (e.g. `!`), make sure to
104 wrap it in single quotes instead of double quotes, so those characters are not
4e4ce920 »
2012-04-29 README updates
105 interpreted by your shell. (However, if you use single quotes, your Tweet
106 obviously can't contain any apostrophes.)
107
108 ### Retrieve detailed information about a Twitter user
109 t whois @sferik
730090fc »
2012-04-24 Add a note about characters being interpreted by your shell against y…
110
4e4ce920 »
2012-04-29 README updates
111 ### Retrieve stats for multiple users
d0490923 »
2012-04-24 More consistent use of @ signs throughout
112 t users -l @sferik @gem
8f54d11c »
2011-11-22 Initial commit
113
4991875f »
2012-04-29 Remove anchors since they are now inserted by GitHub automatically!
114 ### Follow users
d0490923 »
2012-04-24 More consistent use of @ signs throughout
115 t follow @sferik @gem
8f54d11c »
2011-11-22 Initial commit
116
4e4ce920 »
2012-04-29 README updates
117 ### Check whether one user follows another
588545ba »
2012-04-26 Add does_contain and does_follow commands
118 t does_follow @ev @sferik
119
4e4ce920 »
2012-04-29 README updates
120 **Note**: If the first user does not follow the second, `t` will exit with a
121 non-zero exit code. This allows you to execute commands conditionally, for
52a1c4ca »
2012-05-01 Show last 20 results before starting to stream
122 example, send a user a direct message only if he already follows you:
588545ba »
2012-04-26 Add does_contain and does_follow commands
123
4e4ce920 »
2012-04-29 README updates
124 t does_follow @ev && t dm @ev "What's up, bro?"
588545ba »
2012-04-26 Add does_contain and does_follow commands
125
4e4ce920 »
2012-04-29 README updates
126 ### Create a list for everyone you're following
7b69873c »
2012-04-29 Reorganize usage examples
127 t list create following-`date "+%Y-%m-%d"`
128
4e4ce920 »
2012-04-29 README updates
129 ### Add everyone you're following to that list (up to 500 users)
7b69873c »
2012-04-29 Reorganize usage examples
130 t followings | xargs t list add following-`date "+%Y-%m-%d"`
131
4e4ce920 »
2012-04-29 README updates
132 ### List all the members of a list, in long format
133 t list members -l following-`date "+%Y-%m-%d"`
7b69873c »
2012-04-29 Reorganize usage examples
134
135 ### List all your lists, in long format
136 t lists -l
137
52a1c4ca »
2012-05-01 Show last 20 results before starting to stream
138 ### List all your friends, in long format, ordered by number of followers
b4e513b5 »
2012-07-08 Change sort flag to enum
139 t friends -l --sort=followers
8f54d11c »
2011-11-22 Initial commit
140
4991875f »
2012-04-29 Remove anchors since they are now inserted by GitHub automatically!
141 ### List all your leaders (people you follow who don't follow you back)
b4e513b5 »
2012-07-08 Change sort flag to enum
142 t leaders -l --sort=followers
5511c87f »
2011-12-12 Add follow/unfollow all commands [ci skip]
143
4991875f »
2012-04-29 Remove anchors since they are now inserted by GitHub automatically!
144 ### Unfollow everyone you follow who doesn't follow you back
3210a848 »
2012-04-22 Major refactoring for version 0.5
145 t leaders | xargs t unfollow
5511c87f »
2011-12-12 Add follow/unfollow all commands [ci skip]
146
c4be2db5 »
2012-06-12 Display and allow sorting by last Tweet time
147 ### Unfollow 10 people who haven't tweeted in the longest time
b4e513b5 »
2012-07-08 Change sort flag to enum
148 t followings -l --sort=tweeted | head -10 | awk '{print $1}' | xargs t unfollow
c4be2db5 »
2012-06-12 Display and allow sorting by last Tweet time
149
52a1c4ca »
2012-05-01 Show last 20 results before starting to stream
150 ### Twitter roulette: randomly follow someone who follows you (who you don't already follow)
77f06f28 »
2012-05-07 Rename disciples to groupies
151 t groupies | shuf | head -1 | xargs t follow
5511c87f »
2011-12-12 Add follow/unfollow all commands [ci skip]
152
4991875f »
2012-04-29 Remove anchors since they are now inserted by GitHub automatically!
153 ### Favorite the last 10 tweets that mention you
b65c3cbb »
2012-04-27 More copy changes
154 t mentions -n 10 -l | awk '{print $1}' | xargs t favorite
21cec330 »
2012-04-24 Demonstrate how to favorite the last 10 tweets that mention you
155
4e4ce920 »
2012-04-29 README updates
156 ### Output the last 200 tweets in your timeline to a CSV file
157 t timeline -n 200 --csv > timeline.csv
158
52a1c4ca »
2012-05-01 Show last 20 results before starting to stream
159 ### Start streaming your timeline (Control-C to stop)
160 t stream timeline
9beebc39 »
2012-05-01 Add streaming to timeline method
161
7b69873c »
2012-04-29 Reorganize usage examples
162 ### Count the number of employees who work for Twitter
d09821c6 »
2012-04-24 Fix typo in the examples
163 t list members twitter team | wc -l
8fd107bb »
2011-12-26 Document search methods
164
4991875f »
2012-04-29 Remove anchors since they are now inserted by GitHub automatically!
165 ### Search Twitter for the 20 most recent Tweets that match a specified query
25105145 »
2012-03-28 Add new methods to README
166 t search all "query"
167
4e4ce920 »
2012-04-29 README updates
168 ### Download the latest Linux kernel via BitTorrent (possibly NSFW, depending where you work)
169 t search all "lang:en filter:links linux torrent" -n 1 | grep -o "http://t.co/[0-9A-Za-z]*" | xargs open
8a8bfdf9 »
2012-04-29 These usage examples are starting to get interesting
170
4991875f »
2012-04-29 Remove anchors since they are now inserted by GitHub automatically!
171 ### Search Tweets you've favorited that match a specified query
25105145 »
2012-03-28 Add new methods to README
172 t search favorites "query"
173
4991875f »
2012-04-29 Remove anchors since they are now inserted by GitHub automatically!
174 ### Search Tweets mentioning you that match a specified query
25105145 »
2012-03-28 Add new methods to README
175 t search mentions "query"
176
4991875f »
2012-04-29 Remove anchors since they are now inserted by GitHub automatically!
177 ### Search Tweets you've retweeted that match a specified query
25105145 »
2012-03-28 Add new methods to README
178 t search retweets "query"
8fd107bb »
2011-12-26 Document search methods
179
4991875f »
2012-04-29 Remove anchors since they are now inserted by GitHub automatically!
180 ### Search Tweets in your timeline that match a specified query
25105145 »
2012-03-28 Add new methods to README
181 t search timeline "query"
8fd107bb »
2011-12-26 Document search methods
182
7b69873c »
2012-04-29 Reorganize usage examples
183 ### Search Tweets in another user's timeline that match a specified query
bfe6224d »
2012-10-02 Fix typo
184 t search timeline @sferik "query"
8fd107bb »
2011-12-26 Document search methods
185
4991875f »
2012-04-29 Remove anchors since they are now inserted by GitHub automatically!
186 ## Features
4e4ce920 »
2012-04-29 README updates
187 * Deep search: Instead of using the Twitter Search API, [which only only goes
b4e513b5 »
2012-07-08 Change sort flag to enum
188 back 6-9 days][search], `t search` fetches up to 3,200 tweets via the REST API
4e4ce920 »
2012-04-29 README updates
189 and then checks each one against a regular expression.
b4e513b5 »
2012-07-08 Change sort flag to enum
190 * Multi-threaded: Whenever possible, Twitter API requests are made in parallel,
8fbd6edf »
2012-04-24 Add Features section
191 resulting in faster performance for bulk operations.
7b69873c »
2012-04-29 Reorganize usage examples
192 * Designed for Unix: Output is designed to be piped to other Unix utilities,
a1928ea5 »
2012-06-07 Recommend comm for set comparisons
193 like grep, comm, cut, awk, bc, wc, and xargs for advanced text processing.
4e4ce920 »
2012-04-29 README updates
194 * Generate spreadsheets: Convert the output of any command to CSV format simply
195 by adding the `--csv` flag.
9beebc39 »
2012-05-01 Add streaming to timeline method
196 * 95% C0 Code Coverage: Well tested, with a 2.5:1 test-to-code ratio.
4e4ce920 »
2012-04-29 README updates
197
198 [search]: https://dev.twitter.com/docs/using-search
8fbd6edf »
2012-04-24 Add Features section
199
dd41bfdb »
2012-05-09 Add links to blog post and podcast
200 # Using T for Backup
201
202 [@jphpsf][jphpsf] wrote a [blog post][blog] explaining how to use `t` to backup
203 your Twitter account.
204
205 [jphpsf]: https://github.com/jphpsf
206 [blog]: http://blog.jphpsf.com/2012/05/07/backing-up-your-twitter-account-with-t/
207
208 `t` was also mentioned on [an episode of the Ruby 5 podcast][ruby5].
209
210 [ruby5]: http://ruby5.envylabs.com/episodes/273-episode-269-may-4th-2012/stories/2400-t-command-line-power-tool-for-twitter
211
212 If you discuss `t` in a blog post or podcast, [let me know][email] and I'll
213 link it here.
214
215 [email]: mailto:sferik@gmail.com
216
4991875f »
2012-04-29 Remove anchors since they are now inserted by GitHub automatically!
217 ## Relationship Terminology
8953134e »
2012-04-24 Add section on Twitter Relationship Terminology
218
219 There is some ambiguity in the terminology used to describe relationships on
7b69873c »
2012-04-29 Reorganize usage examples
220 Twitter. For example, some people use the term "friends" to mean everyone you
221 follow. In `t`, "friends" refers to just the subset of people who follow you
222 back (i.e., friendship is bidirectional). Here is the full table of terminology
4e4ce920 »
2012-04-29 README updates
223 used by `t`:
8953134e »
2012-04-24 Add section on Twitter Relationship Terminology
224
a7a75aae »
2012-04-24 Reformat table [ci skip]
225 ___________________________________________________
226 | | |
227 | YOU FOLLOW THEM | YOU DON'T FOLLOW THEM |
4c3c54b6 »
2012-04-24 Add disciples methods that returns followers minus friends.
228 _________________________|_________________________|_________________________|_________________________
229 | | | | |
77f06f28 »
2012-05-07 Rename disciples to groupies
230 | THEY FOLLOW YOU | friends | groupies | followers |
4c3c54b6 »
2012-04-24 Add disciples methods that returns followers minus friends.
231 |_________________________|_________________________|_________________________|_________________________|
232 | | |
233 | THEY DON'T FOLLOW YOU | leaders |
234 |_________________________|_________________________|
a7a75aae »
2012-04-24 Reformat table [ci skip]
235 | |
236 | followings |
237 |_________________________|
8953134e »
2012-04-24 Add section on Twitter Relationship Terminology
238
4991875f »
2012-04-29 Remove anchors since they are now inserted by GitHub automatically!
239 ## Screenshots
f9602911 »
2012-04-29 Add screenshots
240 ![Timeline](https://github.com/sferik/t/raw/master/screenshots/timeline.png)
241 ![List](https://github.com/sferik/t/raw/master/screenshots/list.png)
242
4991875f »
2012-04-29 Remove anchors since they are now inserted by GitHub automatically!
243 ## History
48dbd537 »
2011-12-16 Update README
244 The [twitter gem][gem] previously contained a command-line interface, up until
245 version 0.5.0, when it was [removed][]. This project is offered as a sucessor
246 to that effort, however it is a clean room implementation that contains none of
4e4ce920 »
2012-04-29 README updates
247 the original code.
48dbd537 »
2011-12-16 Update README
248
75c72d50 »
2012-05-09 Clean up #40
249 [gem]: https://rubygems.org/gems/twitter
48dbd537 »
2011-12-16 Update README
250 [removed]: https://github.com/jnunemaker/twitter/commit/dd2445e3e2c97f38b28a3f32ea902536b3897adf
7b69873c »
2012-04-29 Reorganize usage examples
251 ![History](https://github.com/sferik/t/raw/master/screenshots/history.png)
48dbd537 »
2011-12-16 Update README
252
4991875f »
2012-04-29 Remove anchors since they are now inserted by GitHub automatically!
253 ## Contributing
6a699033 »
2012-05-07 Add Pledgie campaign link
254 In the spirit of [free software][free-sw], **everyone** is encouraged to help
8f54d11c »
2011-11-22 Initial commit
255 improve this project.
256
6a699033 »
2012-05-07 Add Pledgie campaign link
257 [free-sw]: http://www.fsf.org/licensing/essays/free-sw.html
8f54d11c »
2011-11-22 Initial commit
258
259 Here are some ways *you* can contribute:
260
261 * by using alpha, beta, and prerelease versions
262 * by reporting bugs
263 * by suggesting new features
264 * by writing or editing documentation
265 * by writing specifications
266 * by writing code (**no patch is too small**: fix typos, add comments, clean up
267 inconsistent whitespace)
268 * by refactoring code
b0b5ce35 »
2012-04-30 Re-number list
269 * by fixing [issues][]
8f54d11c »
2011-11-22 Initial commit
270 * by reviewing patches
6a699033 »
2012-05-07 Add Pledgie campaign link
271 * [financially][pledgie]
8f54d11c »
2011-11-22 Initial commit
272
273 [issues]: https://github.com/sferik/t/issues
274
4991875f »
2012-04-29 Remove anchors since they are now inserted by GitHub automatically!
275 ## Submitting an Issue
8f54d11c »
2011-11-22 Initial commit
276 We use the [GitHub issue tracker][issues] to track bugs and features. Before
277 submitting a bug report or feature request, check to make sure it hasn't
ae9e8482 »
2012-04-30 GitHub removed voting on issues a while ago
278 already been submitted. When submitting a bug report, please include a [Gist][]
279 that includes a stack trace and any details that may be necessary to reproduce
280 the bug, including your gem version, Ruby version, and operating system.
281 Ideally, a bug report should include a pull request with failing specs.
4e403428 »
2011-12-01 Add dependency status [ci skip]
282
283 [gist]: https://gist.github.com/
8f54d11c »
2011-11-22 Initial commit
284
4991875f »
2012-04-29 Remove anchors since they are now inserted by GitHub automatically!
285 ## Submitting a Pull Request
4e4ce920 »
2012-04-29 README updates
286 1. [Fork the repository.][fork]
287 2. [Create a topic branch.][branch]
288 3. Add specs for your unimplemented feature or bug fix.
289 4. Run `bundle exec rake spec`. If your specs pass, return to step 3.
290 5. Implement your feature or bug fix.
291 6. Run `bundle exec rake spec`. If your specs fail, return to step 5.
292 7. Run `open coverage/index.html`. If your changes are not completely covered
293 by your tests, return to step 3.
b0b5ce35 »
2012-04-30 Re-number list
294 8. Add, commit, and push your changes.
295 9. [Submit a pull request.][pr]
4e4ce920 »
2012-04-29 README updates
296
297 [fork]: http://help.github.com/fork-a-repo/
298 [branch]: http://learn.github.com/p/branching.html
299 [pr]: http://help.github.com/send-pull-requests/
8f54d11c »
2011-11-22 Initial commit
300
4991875f »
2012-04-29 Remove anchors since they are now inserted by GitHub automatically!
301 ## Supported Ruby Versions
498dba2f »
2011-12-03 Make status images more consistent [ci skip]
302 This library aims to support and is [tested against][travis] the following Ruby
8f54d11c »
2011-11-22 Initial commit
303 implementations:
304
305 * Ruby 1.8.7
306 * Ruby 1.9.2
4e403428 »
2011-12-01 Add dependency status [ci skip]
307 * Ruby 1.9.3
8f54d11c »
2011-11-22 Initial commit
308
4e4ce920 »
2012-04-29 README updates
309 If something doesn't work on one of these Ruby versions, it's a bug.
8f54d11c »
2011-11-22 Initial commit
310
311 This library may inadvertently work (or seem to work) on other Ruby
312 implementations, however support will only be provided for the versions listed
313 above.
314
315 If you would like this library to support another Ruby version, you may
316 volunteer to be a maintainer. Being a maintainer entails making sure all tests
317 run and pass on that implementation. When something breaks on your
4e4ce920 »
2012-04-29 README updates
318 implementation, you will be responsible for providing patches in a timely
319 fashion. If critical issues for a particular implementation exist at the time
320 of a major release, support for that Ruby version may be dropped.
8f54d11c »
2011-11-22 Initial commit
321
4991875f »
2012-04-29 Remove anchors since they are now inserted by GitHub automatically!
322 ## Copyright
75c72d50 »
2012-05-09 Clean up #40
323 Copyright (c) 2011 Erik Michaels-Ober. See [LICENSE][] for details.
324 Application icon by [@nvk][nvk].
8f54d11c »
2011-11-22 Initial commit
325 [license]: https://github.com/sferik/t/blob/master/LICENSE.md
75c72d50 »
2012-05-09 Clean up #40
326 [nvk]: http://rodolfonovak.com
Something went wrong with that request. Please try again.