user47145
user47145

Reputation: 1825

Are there CPAN modules that will help me parse an RSS or ATOM feed in Perl?

I need code in Perl for requesting and parsing ATOM and RSS feeds. Is there a CPAN module(s) for that?

Upvotes: 8

Views: 2110

Answers (4)

brian d foy
brian d foy

Reputation: 132802

Almost any time that you ask "How can I do X in Perl?", the answer is to look at CPAN Search to find the module that does it.

To download from the web, the LWP family of modules can help you. To parse the documents, try something with Feed, RSS, or Atom in the name.

Four years later, though, I now recommend Mojolicious, which has its own user agent module and very strong support for DOM parsing and the various ways to pull out parts of a document. Depending on what you want, you probably don't need a special feed module anymore.

Upvotes: 16

genehack
genehack

Reputation: 140728

I've found that XML::Feed does a much better job of dealing with the errors that you are going to get if you're trying to parse arbitrary feeds that you don't control the generation of.

Upvotes: 0

Fred
Fred

Reputation:

Both XML::RSS and XML::Atom exist. Be warned -- XML::Atom does not seem to be actively maintained and reportedly has bugs. But the basics should be enough to get you going.

To fetch the feeds LWP::Simple is a good choice.

Upvotes: 4

mjy
mjy

Reputation: 2767

XML::FeedPP is good ...

Upvotes: 9

Related Questions