Stackoverflow's feeds are Atom feeds and I was not able to parse them using XML::RSS
itself and have tried other parsers that are currently developed but still unsuccessful. The closest that I have got to parsing out the feeds was with the XML::Atom::Feed
module, but can not wrap my brain around dereferencing the link objects of the entries.
use strict;
use warnings;
use feature 'say';
use XML::Atom::Feed;
my $url = 'http://stackoverflow.com/feeds/tag?tagnames=r&sort=newest';
my $feed = XML::Atom::Feed->new(URI->new($url))
or die XML::Atom::Feed->errstr;
for ($feed->entries) {
say $_->title, "\n", $_->link;
}
Which outputs the latest thirty entries as follows:
Rcpp: Returning C array as NumericMatrix to R
XML::Atom::Link=HASH(0x24cbf00)
I was aware that the link object was a hash reference but I seem to be missing something.
Also, is there another module better for parsing XML Atom feeds?