开发者

I need a RSS and Atom reader API for php!

I'm working on a PHP based feed reader and I'm 开发者_运维技巧using a reader class I've written myself. The problem is that I can't decide on where to go next. I have RSS 1.0 support but I also want it to support 2.0 and Atom.

I've been looking into different XML-reading technologies, and currently I'm using the DOMdocument for reading. But since I only need reading capability and not writing it seems a but overkill because I also want this application to be as fast and lightweight as possible. So I can't decide on whether I should use SAX, SimpleXML, XMLReader, DOM or XPath. From my understanding would SAX be the most lightweight alternative since it doesn't load the whole document into an object but only scan the document, right?

This all seemed a bit heavy when I researched it and that's why I started looking into already existing API's.

I've looked into Magpierss and Simplepie but both of them are terribly outdated. I want to use Simplepie but it lacks PHP 5 support. So what are your suggestions for a lightweight and fast solution to this?


How about using the Google Reader API (unofficial). What it does it to rewrite any RSS feed that you specify into ATOM. To use, just append the feed's URL to:

http://www.google.com/reader/atom/feed/{URLENCODED_RSSFEED_URL}

For example, compare the Twitter Search RSS feed (MRSS format): http://search.twitter.com/search.rss?q=stackoverflow

Rewritten to ATOM: http://www.google.com/reader/atom/feed/http%3A%2F%2Fsearch.twitter.com%2Fsearch.rss%3Fq%3Dstackoverflow

No authentication is needed to access this function in GReader's API. More info can be found at GoogleReaderAPI at Google Code.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜