Tudor Barbu's blog

Ramblings about software development

I 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 a SQL dump file every time he posts something on the blog.

And really, do you need *all* the posts in the database? Do you really want to advertise blog entries from 2 years ago? Come on!

My idea is much better…obviously :P …and it goes like this: parse the blog’s RSS and take “inspiration” from there for the statuses. The weapon of choice for this task is python with its feedparser library.

First, some prerequisites:

sudo apt-get install python-feedparser

…and then, the python script:

#!/usr/bin/python
import feedparser
import random
import os

# feed url
FEED = 'http://feeds2.feedburner.com/motanelu'

feed = feedparser.parse( FEED )
index = random.randrange(0, len( feed['items'] ) - 1 )
status = 'purple-remote "setstatus?status=available&message=%s %s"' % ( feed['items'][index].title, feed['items'][index].link )
os.system( status )

# EOF

I consider this approach better than Radu’s, because it doesn’t require exporting the database or messing around with fortune. Read this post to see how to update Pidgin’s status using cron. And enjoy :P

24 Jun

Pidgin, Ubuntu and Yahoo! Messenger

Posted by Tudor. Tags: , , ,

Pidgin Starting yesterday, my Pidgin stopped connecting to Yahoo!’s messenger service (MSN kept working). Being lazy, I’ve just changed the scs.msg.yahoo.com host to 66.163.181.166 in the user profile panel – the first solution I’ve came across on Google – and it started working again. For another day or so.

But today, it stopped working again and I couldn’t get it working again. So I’ve used Meebo to go online and ask others if their YM! clients worked, if they’ve also encountered this problem, and, most important, what did they do to fix it. And – thanks to Radu – I’ve found out the root of this problem: Yahoo! changed the specifications of its im protocol. Fortunately, the Pidgin guys don’t waste time and the problem can be solved by upgrading to Pidgin 2.5.7.

Details here and here.