Python
14 Oct 2008 HTML Text
 
 
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
class MRSSFeed(Atom1Feed):
    def root_attributes(self):
        attrs = super(MRSSFeed, self).root_attributes()
        attrs['xmlns:media'] = 'http://search.yahoo.com/mrss/'
        return attrs

    def add_item_elements(self, handler, item):
        super(MRSSFeed, self).add_item_elements(handler, item)
        handler.addQuickElement('media:content', None, {'url': item['picture'], 'type': 'image/jpeg',
            'width': item['picture_width'], 'height': item['picture_height']})