views:

746

answers:

6

Hello,

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!

+2  A: 

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
+4  A: 

Try these two, they both do RSS and Atom:

Philip Morton
SimplePie is great...
yoavf
Using SimplePie now, works great.
Tom
PHP's greatest rss/api parser -> http://coreylib.com
Kenneth Reitz
+1  A: 

http://magpierss.sourceforge.net/

Priyank Bolia
+1  A: 

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  A: 

You can find a FeedReader here.. http://tecserver.blogspot.com/2009/07/php-rss-reader-atom-reader.html

+1  A: 

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/.

Md. Rayhan Chowdhury