Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Using XML::RSS to produce an RSS 2.0 feed with Dates within Items

by Anonymous Monk
on Nov 18, 2019 at 07:39 UTC ( #11108855=note: print w/replies, xml ) Need Help??


in reply to Using XML::RSS to produce an RSS 2.0 feed with Dates within Items

You have a typo: PubDate should be pubDate in $rss->add_item.

Also, from the perldoc: Note: In order to parse and generate dates (such as pubDate and dc:date) it is recommended to use DateTime::Format::Mail and DateTime::Format::W3CDTF , which is what XML::RSS uses internally and requires.

  • Comment on Re: Using XML::RSS to produce an RSS 2.0 feed with Dates within Items

Replies are listed 'Best First'.
Re^2: Using XML::RSS to produce an RSS 2.0 feed with Dates within Items
by mldvx4 (Scribe) on Nov 18, 2019 at 08:57 UTC

    Thanks. Well spotted. It works when I use the correct case. I'll redo the way the date is generated, too

    About the Dublin Core metadata, though, what can be done to add that into RSS 2.0 Items?

      From XML::RSS:
      $rss->add_item (title=>$title, link=>$link, dc=>{ subject=>$subject, c +reator=>$creator, date=>$date });

        Yes, one would think so based on the manual page, but in practice it does not print any of Dublin Core metadata which has been added. The following adds it to the object just fine:

        $rss->add_item( title => $title, link => $link, description => $description, pubDate => $modified_date, dc => { subject=>'foo', date => $modified_date }, );

        And that addition can be seen using Data::Dumper. However, print $rss->as_string; is failing to show the full RSS entry. It shows only certain fields. So my script is still missing something, but what?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://11108855]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2019-12-06 00:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Strict and warnings: which comes first?



    Results (154 votes). Check out past polls.

    Notices?