Fortune and Pidgin’s status on Ubuntu (Linux)

Friday, August 7th 2009, 18:17

Following the post about my laziness and Tudor’s comment from here, I went on to study how fortune works and I have found a way to use it to change your status in Pidgin using posts from your WordPress blog. It’s quite neat if you think and also this trick could bring you more traffic to your blog.

This is the how to:

  1. create a fortune file from your blog posts by performing this query on your blog’s database and writing its output in a text file:
  2. SELECT Concat("%\n", post_title, " ", DATE_FORMAT(post_date, "http://exampleblog.com/%Y/%m/%d/"), post_name) FROM `YourTablePrefix_posts` where post_type='post'

    Add a % (procent sign) at the end of the file, on a separate line.

  3. if you have the fortune-mod package perform this command on your previously obtained text file:
    strfile blog_quotes_text_file blog_quotes.dat
  4. move blog_quotes_text_file and blog_quotes.dat to /usr/share/games/fortunes
    sudo cp blog_quotes_text_file blog_quotes.dat /usr/share/games/fortunes
  5. download my tiny script from here (make it executable) and add it to cron setting how often to change your status (in the example this will be done at every 15 minutes). Take a look here for setting crontab do handle Pidgin’s status

Now just wait and see. :)

Update: Python and Pidgin’s status on Ubuntu (Linux)

You might also like:

2 Comments

Leave a comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>


CODE EXAMPLES: When you want to include source code or terminal output, please use the the following tags like in the next example:

    [language]
    code lines
    [/language]
	

where you substitute language with the programming laguage used throught the code example (for terminal output that would be bash), e.g:

    [bash]
    /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
    [/bash]
	

To see a list of all the supported languages, please check this page.

If you want to include code bits inline, please use the code tags like in the following example:

    The <code>$USER</code> variable holds the current logged in username.
	

Projects that I support

Recent Comments

  • nope said:
    yeah that was my first thought too, but: mount: warning: seems to be mounted read-write. too bad, would have been just perfect. more»
  • Klaus Deiss said:
    Dear Radu, I tried it on Ubuntu 10.0.4.2 and 10.0.4.3 with different kernel versions (amd64 server 2.6.32 kernel). No... more»
  • scompo said:
    Nope.. Now it’s not working again.. This printer it’s a real pain in the butt.. The other hp printer I had... more»
  • Dmitrij said:
    Thank you Peter and Patrice. Could you please post the updated script? more»
  • hd_flash_pains said:
    didn’t work for me more»

Recent Tweets

Bear