blogging

Supybot/Python help needed

For a long time I have been frustrated by the fact that Supybot's RSS plugin only supported RSS feeds, and not ATOM as well, as some of my friends' blogs only offer the ATOM format. I did some Googling, and discovered a workaround involving substituting feedparser for rssparser in the plugin.py. However, I now have a new error, which there is a fair bit of mention about on the internet, but little in the way of solutions. It seems to affect anything python-related (MoinMoin, Supybot, Plone, etc.), and involves the translation of ASCII and UTF-8 character encodings. As I'm not very knowledgeable in this area, I would very much appreciated whatever information and/or fixes you can offer. Here's my log output:

INFO 2007-08-20T01:52:19 rss planetubuntu called by
"tonyyarusso!n=anthony@ubuntu/member/tonyyarusso".
ERROR 2007-08-20T01:52:19 Uncaught exception in ['rss', 'planetubuntu'].
Traceback (most recent call last):
File "/var/lib/python-support/python2.5/supybot/callbacks.py", line 1170, in _callCommand
self.callCommand(command, irc, msg, *args, **kwargs)
File "/var/lib/python-support/python2.5/supybot/utils/python.py", line 62, in g
f(self, *args, **kwargs)
File "/var/lib/python-support/python2.5/supybot/callbacks.py", line 1156, in callCommand
method(irc, msg, *args, **kwargs)
File "/var/lib/python-support/python2.5/supybot/plugins/RSS/plugin.py", line 294, in f
self.rss(irc, msg, args)
File "/var/lib/python-support/python2.5/supybot/commands.py", line 906, in newf
f(self, irc, msg, args, *state.args, **state.kwargs)
File "/var/lib/python-support/python2.5/supybot/plugins/RSS/plugin.py", line 383, in rss
headlines = self.buildHeadlines(headlines, channel, 'showLinks')
File "/var/lib/python-support/python2.5/supybot/plugins/RSS/plugin.py", line 142, in buildHeadlines
newheadlines.append(format('%s %u', *headline))
File "/var/lib/python-support/python2.5/supybot/utils/str.py", line 430, in format
return _formatRe.sub(sub, s)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 21: ordinal not in range(128)
ERROR 2007-08-20T01:52:19 Exception id: 0xe9e69

(Note: this is using http://planet.ubuntu.com/rss20.xml as the feed URL, and worked with the old rssparser. A number of other feeds are affected as well, including the individual site feeds of Hobbsee, ryanakca, johnc4510, jnthnjng, and LaserJock.)

Explanation of RSS

Thanks to Aaron Toponce for pointing this out; finally something that might help some of you understand the idea behind RSS. The direct link to the video is http://www.commoncraft.com/rss_plain_english. In short, the idea of RSS is to save everyone time and energy, which is why I very much appreciate it when people have RSS feeds to follow, as both of those things are in short supply much of the time. In case you hadn't noticed, my site has feeds that you can follow if you so choose (varies depending on which mirror you're reading - ask if you can't find it), in some cases both as RSS and Atom feed options.

If you don't like the online readers mentioned in the video, I recommend the Sage plugin for Firefox for those who like extensions in their browser, Liferea for a standalone application (Linux - Gnome, remember to use repos where applicable), Mozilla Thunderbird's built-in RSS capability if you want it in your e-mail program, and Planet if you're either just a python geek or want to make a publicly accessible web page aggregating multiple feeds.

Syndicate content