Im using a Perl sript to do a variety of automation functions and I’m creating an RSS feed of the log output using XML::RSS. I am using RSS2.0 for the feed as the default 1.0 that XML::RSS creates was not working properly.
It seems fairly trivial to add an image to go at the top of the whole feed. But what I’d like to do is add an image (or a small thumbnail) for each item (a green tick / red cross). The RSS standard indicated that this should be accomplished with the <media:thumbnail> or <Media:content> tags, but I can’t figure out how to implement this with the XML::RSS module.
Has anyone got any ideas. My feed updater currently looks like this.
my $rss = new XML::RSS (version => '2.0');
$rss->parsefile($localFeed) or die;
pop(@{$rss->{'items'}}) if (@{$rss->{'items'}} == 15);
$rss->add_item(title => "$_[0]",
description => "$_[1]",
pubDate => "$dtString",
mode => 'insert'
);
$rss->save($localFeed);
Thanks
Ok, i’ll have a bash at describing how I solved it in the end. I’m not sure if this is the best way but it seems to work. I shamelessly ripped this from another internet posting, but can’t for the life of me remember where so unfortunately I can’t give credit where it is due.
I added the “media” module using the following statement before the parse command:
Now, my add item statement can contain the following syntax and XML::RSS will just add it into the feed without complaint
Not forgetting the
statement. Now I just need to find a decent browser and mobile RSS reader that will actually display media:thumbnail tags as images
Hope this helps others trying to achieve similar results.