是否有RSS和ATOM的PHP提要阅读器?

时间:2022-07-12 12:12:05

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.

我需要一个PHP库/脚本,可以从源中检索数据,无论它们是RSS还是ATOM,因为我希望用户插入随机源,然后将其存储在数据库中。如果它可以检查给定的URL是否是一个feed也是很好的。

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

如果有任何可以帮助我的东西,有人可以告诉我吗?谢谢!

4 个解决方案

#1


Try these two, they both do RSS and Atom:

尝试这两个,他们都做RSS和Atom:

#2


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.

Zend_Feed提供了使用RSS和Atom提要的功能。它提供了访问提要,提要属性和条目属性元素的自然语法。 Zend_Feed还支持使用相同的自然语法修改feed和entry结构,并将结果转换回XML。将来,此修改支持可以为Atom发布协议提供支持。

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

您不必使用整个Zend Framework,只需使用Zend_Feed组件及其依赖项。

#3


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

最近我创建了一个php feed阅读器类,它可以解析RSS和Atom提要。这是链接http://raynux.com/blog/2009/09/02/rayfeedreader-php-class-for-parsing-rss-and-atom-feed/。

#4


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.

这可以通过SimpleXML轻松处理,并且除了您自己之外不需要任何其他人的代码。请记住,如果您提供的文件无效或不存在,SimpleXML将自行废弃。使用try / catch + execeptions。

http://us2.php.net/simplexml

#1


Try these two, they both do RSS and Atom:

尝试这两个,他们都做RSS和Atom:

#2


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.

Zend_Feed提供了使用RSS和Atom提要的功能。它提供了访问提要,提要属性和条目属性元素的自然语法。 Zend_Feed还支持使用相同的自然语法修改feed和entry结构,并将结果转换回XML。将来,此修改支持可以为Atom发布协议提供支持。

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

您不必使用整个Zend Framework,只需使用Zend_Feed组件及其依赖项。

#3


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

最近我创建了一个php feed阅读器类,它可以解析RSS和Atom提要。这是链接http://raynux.com/blog/2009/09/02/rayfeedreader-php-class-for-parsing-rss-and-atom-feed/。

#4


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.

这可以通过SimpleXML轻松处理,并且除了您自己之外不需要任何其他人的代码。请记住,如果您提供的文件无效或不存在,SimpleXML将自行废弃。使用try / catch + execeptions。

http://us2.php.net/simplexml