RSS Enclosure Malarkey
Home
Nov2
Pictures
Trying to put enclosures in my RSS using XML::RSS, but no matter what I try to add, the enclosure is ignored...
%item = (
'enclosure' => {
'type' => 'text/html',
'length' => '877',
'url' => 'http://www.lauraashley.com/'
},
'link' => 'http://www.clarkeology.com/stokey/22/12/',
'description' => 'Just trying to get a catalogue from lauraashley.com...',
'pubDate' => 'Tue, 2 Nov 2004 13:41:33 GMT',
'permaLink' => 'http://www.clarkeology.com/stokey/22/12/',
'title' => 'If you blog it, they will come'
)
$rss->add_item( %item );
The item's added every time, but the enclosure is ignored... are enclosures not supported in RSS 2.0? It's driving me mad...
2004 :: Comment / reply
Pictures
Looks ok to me from the snippet - are you setting the
Also, I thought the XML::RSS support for 2.0 was in its very early stages at the moment so it may need more work before it supports everything you need it to do? Fairly sure it has full support for 0.9, 0.91, 0.92 and 1.0. I think enclosures were introduced back in 0.92 though so maybe the module's a bit buggy for 2.0 - what happens if you change the rss version header back e.g. "my $rss = new XML::RSS (version => '0.92');"?
Also, why are you puttin your attribute names in quotes? That might be causing it?
itchypaws :: 4 Nov :: 2004 :: Comment / reply
Pictures
I suspect it's that XML::RSS isn't finished, but I will investigate further... You might have hit the nail on the head, I'm not specifically predeclaring the enclosures, maybe I need to do that, I thought XML::RSS would pick it up. There's no mention of it in any of the docs... I'm off to post a query on https://sourceforge.net/forum/forum.php?thread_id=1173663&forum_id=227260 sourceforge.net...
I'm not putting the attributes in quotes in the real code, that bit I pasted onto the board was the output of Dumper( %item ), so I could see what was going in...
Got to run now, speak later, looking forward to next weekend...
