Gossamer Forum
Quote Reply
Parsing XML News Feeds
Has anyone figured out how to parse xml news feeds into Links???
Trying to do:
http://www.washingtonpost.com/wp-srv/world/rssheadlines.xml

</not a clue>
Quote Reply
Re: [Dinky] Parsing XML News Feeds In reply to
Not sure how helpful this will be, but I normally use XML::Simple.

Something like;

Code:
use XML::Simple;

my $page = get("http://www.washingtonpost.com/wp-srv/world/rssheadlines.xml ");

my $xml = XMLin($page);

if (ref $xml->{chanel}->{item} eq "ARRAY") {
for (my $i = 0; $i <= 25; $i++) {
print "Title: " . $xml->{chanel}->{item}[$i] . "\n<br/>";
}
} else {
print "Title: " . $xml->{chanel}->{item} . "\n<br/>";
}

This is totally untested.. but *should* work :)

Cheers

Andy (mod)
andy@ultranerds.co.uk


IMPORTANT: I've now moved to ultranerds.co.uk, and the .com will no longer work!
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates