Using Twitter CLI to do a Raffle

Today I played around with a Twitter command line client called t. My motivation was the raffle we are doing at the Vienna Scala User Group where people can send a tweet to @ScalaVienna to participate in the raffle. And I quickly found what I needed:

t search mentions "CraftConf"

gives me the tweets I’m interested in.

We will do the raffle at our next meetup adding little sheets of paper with twitter handles to the hat from where we draw the winner. But you could do a Twitter raffle just with the command line:

t search mentions "CraftConf" --csv
| awk '{ if (NR>1) print $0; }' # drop the first line
| shuf                          # permutate
| head -n 1                     # first line

The power of the command line!


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s