
T – a command-line power tool for Twitter - lelf
http://sferik.github.io/t/
======
jhallenworld
At WPI, in 1989, we had 's'\- a command line tool (written in ksh!) to send a
message to someone or to your friends logged in. You had a .friends file and a
.enemies file (to blacklist people from contacting you). We also had
"superwho" which gave a graphical map (vt220 graphics) of where everyone was.

Now 25 years later we finally have 'T'! Progress..

~~~
m0nastic
By 1998 (when I was there), I don't remember ever seeing anything like that
(we used normal Unix 'talk' to communicate with people logged into the Digital
Unix servers).

Go Engineers!

~~~
jhallenworld
There was a burst of hacking because of the final transition to UNIX. I was
privileged to experience the much more diverse before time: A DECSYSTEM-20 was
the main campus computer (it used a Z-80/S100 bus custom terminal
multiplexer), the OS course involved writing an OS in PDP-11/23 assembly
language, you could write your documents using the Wang word processing
computer, of course there were VAXen and there was even an IBM mainframe.
There were some UNIX machines (3B2s..), but everything changed when the DEC-20
was replaced with an Encore Multimax and Decstation-2100s (I remember "xtank"
was a popular multiplayer game on them).

I could see the vestiges of the previous burst of hacking in the DEC-20's
student written software library.

The popularity of the messaging programs should have been a big hint to us..

~~~
cbd1984
> a Z-80/S100 bus

What used to be the heart of a microcomputer.

A Serious Business Micro, that is, not a glorified game system like a
Commodore-64.

> xtank

There's documentation of a work to port it to modern systems:

[http://documentation.wikia.com/wiki/Xtank](http://documentation.wikia.com/wiki/Xtank)

Also something on Freecode:

[http://freecode.com/projects/xtank](http://freecode.com/projects/xtank)

------
danso
One of my favorite tools...in fact, I'd argue that T is what got me to finally
understand why, as a programmer, I should still care about CLI (sferik
maintains both T and the excellent Ruby twitter client gem, which powers
T)...Studying the T code has also helped me understand the principles of a
good CLI system...all around, a well-maintained and fun project.

Using the `--csv` flag and a command-line tool like csvkit, you can make all
sorts of utilities. Here's how to unfollow everyone who doesn't follow you:

    
    
           t leaders --csv | csvcut -c 9 | xargs t unfollow
    

Unfollowing everyone who hasn't tweeted since the first half of 2013:

    
    
           t followings --csv | csvgrep -c 3 -r '2013-0[1-6]' | csvcut -c 9 | xargs t unfollow
    
    

Note: I haven't run these in awhile so the field order may have changed...

~~~
rdc12
Looking at some of the examples the csv part is unneeded in the first example.

t leaders | xargs t unfollow #will work

~~~
danso
Oops, you're right. That was a vestigial step for when I was filtering the
list by some standard (e.g. less/greater than certain number of followers) and
then unfollowing.

------
malvosenior
Favorite T hack:

    
    
      t followers --sort=since > followers.log
    

Keep followers.log checked into Git and track your followers/unfollowers over
time.

~~~
ryanseys
I made a thing yesterday to do just that. :)

[https://github.com/ryanseys/twidiff](https://github.com/ryanseys/twidiff)

~~~
D4AHNGM
That's a nice simple little script. Thanks for sharing!

------
lnanek2
Usually this would be banned because it acts as a Twitter client and doesn't
show the ads. In this case you have to sign up for your own app ID, though, so
it will just be banned piece by piece as the Twitter API enforcement bots
catch each instance. I had a lot of apps seemingly auto-killed by Twitter,
games that used to use the API to let you Tweet scores easily, mostly, so
expect this app will be similarly classified.

~~~
sp332
There are other rules this is breaking.
[https://dev.twitter.com/overview/terms/rules-of-the-
road](https://dev.twitter.com/overview/terms/rules-of-the-road)

You must:

4\. not arrange for your Service to be pre-installed on any device, promoted
as a “zero-rated” service, or marketed as part of a specialized data plan.

5\. not frame or otherwise reproduce significant portions of the Twitter
service. You should display Twitter Content from the Twitter API.

~~~
hrrsn
4\. Where is this preinstalled anywhere?

5\. This isn't a full blown Twitter client, just a CLI interface. There's a
difference.

~~~
sp332
Whoops, got the wrong numbers. (The numbers don't copy-and-paste with the
text). I meant: 5. display a prominent link or button in your Service that
directs new users to Twitter’s sign-up functionality.

------
_delirium
This is another one I've used, with a somewhat different set of functionality:
[http://www.floodgap.com/software/ttytter/](http://www.floodgap.com/software/ttytter/)

~~~
privong
I really liked ttytter. I got to where I preferred it over any graphical
clients – the information density was so much higher in the console. Sadly it
has not been updated in a while (and I have since left twitter).

------
eps
Does anyone else remember micq, a command line ICQ client? It was such a
beaut.

~~~
jcurbo
Indeed! I used micq for several years back in the late 90's.

------
turnersd
Been using this for a while in a cron job to automate archiving tweets for
various topics I'm interested in
[https://github.com/stephenturner/twitterchive](https://github.com/stephenturner/twitterchive)

------
mmmmax
I once did a design for this idea. Here!

[https://www.dropbox.com/s/r2v6nq69jk9rw6s/birdcatcher.png?dl...](https://www.dropbox.com/s/r2v6nq69jk9rw6s/birdcatcher.png?dl=0)

------
Argorak
Sadly, got (a go clone of T by the same author) isn't far along:
[https://github.com/sferik/got](https://github.com/sferik/got)

------
rsync
I just skimmed and re-skimmed the usage examples on the page, and I see no
option to actually tweet something.

I assume this has to do with the third party limit ?

~~~
Sir_Cmpwn
t update "I'm tweeting from the command line. Isn't that special?"

------
LeoPanthera
Are there any command line twitter clients that allow the posting of images?
ttytter can't do it, and it seems this "t" can't either.

~~~
hayksaakian
Actually you can, see:

[https://github.com/sferik/t/blob/7f1fcac61047dcb703e9519c837...](https://github.com/sferik/t/blob/7f1fcac61047dcb703e9519c837f7134fd7a7f57/lib/t/cli.rb#L843)

this is because the OP's own twitter ruby gem can do that, this CLI app is
basically a front end for the ruby gem

    
    
        client.update_with_media("I'm tweeting with @gem!", File.new("/path/to/media.png"))
    

[https://github.com/sferik/twitter/blob/48efb642beaa19355a4c1...](https://github.com/sferik/twitter/blob/48efb642beaa19355a4c1ba04a9fadac54cfba42/examples/Update.md#L40)

------
gulbrandr
I don't understand why someone would think that "T" is good name for something
like this.

------
srcmap
Cool, this will makes it easier to script IOT device to use Twitter as
messaging service.

------
soapdog
Very cool tool. Does anyone know of a similar one for Facebook?

~~~
pdenya
There's a privacy option to disable 3rd party app access (FB apps used by
other people) to personal info so nothing as full featured is possible.

~~~
soapdog
thanks for the reply. I am not looking for all those features. I just want to
update status from the command line this way I can use them in my static
generator workflow ;-)

~~~
sefk
I cross-post tweets to FB with this app:
[https://apps.facebook.com/twitter/](https://apps.facebook.com/twitter/). I
wish it had a way not cross-post _everything_ , i.e. with a #nofb tag, but my
volume isn't high enough that that's a concern.

~~~
jcurbo
There used to be a nice FB app called Selective Tweets that let you append #fb
to tweets you wanted to show up on Facebook, but it doesn't seem to work
anymore and seems un-maintained.

------
aftbit
Anyone have a zsh completion file for t?

~~~
rdc12
[https://github.com/sferik/t/blob/master/etc/t-completion.zsh](https://github.com/sferik/t/blob/master/etc/t-completion.zsh)

------
D4AHNGM
This is neat. I had no idea it existed. Forever in love with the power &
simplicity of Ruby.

