Fortune and Pidgin’s status on Ubuntu (Linux)

Posted on August 7th, 2009 at 18:17, in How To, Linux, Ubuntu.

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)

Similar Posts:


2 Comments

Cosu said

on August 14th, 2009,

at 10:34 hours

haha quite neat!

[...] wanted to write this post ever since I’ve read Radu’s Fortune and Pidgin’s status on Ubuntu post. Radu’s approach is quite lame and hard to use, because it relies on the user exporting [...]

Think you've got something to say?

For leaving comments including 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:/usr/games
[/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.

Subscribe without commenting


Bear