Saturday, December 4, 2010

Thimbl TIP: automatic fortune

Thimbl-CLI now has a commit that allows you to create a message by reading from stdin. The command is, rather predictably, 'stdin'.

Here's how you might use it to post a random quote-of-the-day automatically. You will need the UNIX program 'fortune' installed.

Create a file: ~/thortune:

   fortune | python /path/to/ stdin

Set its executable permissions:
   chmod a+x ~/thortune

Edit your crontab file to include the line:
   @daily $HOME/thortune
That should be it!

No comments: