Here's a working sub from a chat bot of mine (UPDATE: some cleanup for OP):

=pod Usage: atom_feed({ feed => 'https://example.com/feed.atom', newer_than => 1440 }); =cut sub atom_feed { my ( $arg ) = @_; my $feed = $arg->{feed}; my $newer_than = exists $arg->{newer_than} ? $arg->{newer_than} : $c->{newer_than}; my @events; warn "Getting atom feed for [$feed] ". "records newer than [$newer_than]min" if $args->{debug}; my $returned_xml = XML::Feed->parse( URI->new( $feed )) or die "Feed error with [$feed] ".XML::Feed->errstr; for my $next_entry ( $returned_xml->entries ) { warn "Got bug title [$next_entry->{title}]" if $args->{debug}; # Get only entries of a specific title and age. if ( $next_entry->title =~ m/\A\w+ # Start \s+ \#\d{4,5} # bug numb +er \s+ \( (Open|Closed|Merged|Rejected|Unconfirmed) \) # Status o +f bug /ix and time_compare({ time => $next_entry->updated, newer_than => $newer_than }) ) { push @events, qq{$next_entry->title, $next_entry->link}; } } say $_ foreach ( @events ); return \@events; }
From here

Neil Watson
watson-wilson.ca


In reply to Re: RSS feed grabber by neilwatson
in thread RSS feed grabber by sushsen

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.