4

I need a PHP library/script that can retreive data from feeds, no matter if they are RSS or ATOM, because I want users to insert random feeds which will then be stored in a database. It would also be great if it could check whether a given URL is a feed or not.

If anything exists that could help me out, could anyone tell me? Thanks!

Dan Lowe
  • 51,713
  • 20
  • 123
  • 112
Tom
  • 8,536
  • 31
  • 133
  • 232

4 Answers4

11

Try these two, they both do RSS and Atom:

Philip Morton
  • 129,733
  • 38
  • 88
  • 97
1

Recently I have created a php feed reader class which can parse both RSS and Atom feed. Here is the link http://raynux.com/blog/2009/09/02/rayfeedreader-php-class-for-parsing-rss-and-atom-feed/.

1

Zend_Feed

Zend_Feed provides functionality for consuming RSS and Atom feeds. It provides a natural syntax for accessing elements of feeds, feed attributes, and entry attributes. Zend_Feed also has extensive support for modifying feed and entry structure with the same natural syntax, and turning the result back into XML. In the future, this modification support could provide support for the Atom Publishing Protocol.

You don't have to use the entire Zend Framework, just take the Zend_Feed component and its dependencies.

Jack Sleight
  • 17,010
  • 6
  • 41
  • 55
  • 1
    But you cannot download only the feed component of the ZF. You always have to get the full big fat thing. – cweiske Jun 03 '11 at 09:10
  • Yeah true. But you can just grab Feed and its dependencies: Exception, Loader, Http, Uri and Validate (http://files.zend.com/help/Zend-Framework/requirements.dependencies.html), delete the rest. – Jack Sleight Jun 13 '11 at 11:02
-1

This can be easily handled by SimpleXML and would require no code from anyone else but yourself. Just remember that SimpleXML will crap itself if you supply it a file that is invalid or doesn't exist. Use try/catch + execeptions.

http://us2.php.net/simplexml

Syntax
  • 1,314
  • 1
  • 7
  • 14
  • 2
    You do not want to parse feeds on your own. There are too many dialects and modifications out there. – cweiske Jun 03 '11 at 09:10