Print a random tweet from the command line

Aug 27, 2010 - Leave a Comment

By pasting the following small function into your .profile, you’ll be able to print random tweets from any Twitter feed:

Once the code is saved into your .profile just type ‘randomosx’ to get a random tweet:
$ randomosx
New: iMac Touch runs both Mac OS X and iOS http://osxdaily.com/2010/08/23/imac-touch-runs-mac-ios/ #apple #mac

In the example code, we are using the OS X Daily Twitter feed, but “shitmydadsays” and “ConanOBrien” both make for a hilarious random tweets. You can also change the function name to something like ‘randomtweet’ or whatever else to fit the feed you are randomizing.

This works in Mac OS X and Linux, and should work in other unix environments as well.

If you like this, why not learn to post tweets from the command line too? Have fun!

Enjoy this tip? Subscribe to the OSXDaily newsletter to get more of our great Apple tips, tricks, and important news delivered to your inbox! Enter your email address below:

Related articles:

Posted by: chrisk in Command Line

Leave a Reply

 

Shop for Apple & Mac Deals on Amazon.com

Subscribe to OSXDaily

Subscribe to RSS Subscribe to Twitter Feed Follow on Facebook Subscribe to eMail Updates