Print a random tweet from the command line

Aug 27, 2010 - Leave a Comment

Twitter icon

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 https://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!

.

Related articles:

Posted by: chrisk in Command Line

Leave a Reply

 

Shop on Amazon.com and help support OSXDaily!

Subscribe to OSXDaily

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

Tips & Tricks

News

iPhone / iPad

Mac

Troubleshooting

Shop on Amazon to help support this site