[Slideshow]: doesn't work for xkcd.com comics

Bug #867404 reported by Rene Glaser
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Individual Screenlets
Fix Released
Undecided
Unassigned

Bug Description

Hello,

OS: Ubuntu 10.10
ver.:Screenlets 0.1.5, Slideshow Screenlet 1.3.3

The Slideshow Screenlet doesn't work properly for the RSS Feed (http://www.xkcd.com/rss.xml) of xkcd.com comics by Randall Munroe.
In the Terminal I can see the following output:
---------------

Trying RSS...
http://www.xkcd.com/rss.xml
Restored instances from session 'default' ...
Opened and read.
4 items found.
Still variety of 4

Traceback (most recent call last):
  File "SlideshowScreenlet.py~", line 504, in fetch_mediaRSS
    imageget = urlopen(realimage)
  File "/usr/lib/python2.6/urllib2.py", line 126, in urlopen
    return _opener.open(url, data, timeout)
  File "/usr/lib/python2.6/urllib2.py", line 383, in open
    protocol = req.get_type()
  File "/usr/lib/python2.6/urllib2.py", line 244, in get_type
    raise ValueError, "unknown url type: %s" % self.__original
ValueError: unknown url type:
Trying Folder...

---------------
The error occurs because of the XML Style of the RSS Feed on this Page. The Slideshow Screenlet is looking for the Image URL within a "<media:content:..." tag, whereas the XML File of xkcd.com delivers its Image URL within a <description> tag (after 'img src="..."').
I don't know, if there are more RSS Feeds with this style. So I just did a little Workaround and just change this for xkcd.com, so there is an if-else statement to look for 'img src="..."' for the Image URL instead of the normal tag, if the self.mediaRSS_URL is "http://www.xkcd.com/rss.xml".
It would be useful, if there are more RSS Feeds with this style, to take care of this.

Revision history for this message
Märt Põder (boamaod) wrote :

You are welcome to join individual screenlets developers team to update Slideshow screenlet. Adding more heuristics to find right URLs for images is completely okay, if it does not break existing functionality. I suggest that extended heuristics should be used if standard routine does not lead to detection of a proper image URL.

Changed in indiv-screenlets:
status: New → Confirmed
Revision history for this message
Rene Glaser (rene-g89) wrote :

So then here is my patched version of SlideshowScreenlet.py, working with xkcd.com RSS Feed. Working well for me.

Revision history for this message
Rene Glaser (rene-g89) wrote :

Oh I just forgot to say, the patched lines are 459 to 511.

Changed in indiv-screenlets:
status: Confirmed → Fix Committed
Märt Põder (boamaod)
Changed in indiv-screenlets:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.