|
|
| go ahead... be a heretic | |
| PerlMonks |
Re^5: Parsing ITEM Tag from RSS feed using XML::RSS::LibXMLby rowdog (Curate) |
| on Jun 28, 2010 at 19:07 UTC ( #846960=note: print w/ replies, xml ) | Need Help?? |
|
I think I see now. You're pushing the links for each item onto an array and then reducing to the set of new links. Once there, you want to get back to the $rss->item that the link came from. You still have $rss so you can find the item by searching. Maybe something like
On reflection, I don't really care for the way you're keeping track of seen items. All that map grep stuff can be replaced with a simple hash. Maybe you'll have more luck if you restructure things a bit. Here's my skeletal example.
As an aside, fetching the RSS file every second is a good way to convince the server that you're attacking it. 15 minutes is probably okay but you should check the Terms of Service to be sure. On that same note, I like LWP::UserAgent's mirror method because it sends the "If-Modified-Since" header so you don't fetch the file if it hasn't changed.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||