convert rss to JSON [closed]

社会主义新天地 提交于 2019-11-28 18:24:36

UPDATE: beware, Yahoo Pipes has now been shutdown by Yahoo! and the Google Feed API has been deprecated. Check superfeedr.com's API which also does RSS to JSON conversion.

You can use google feed api service

Example:

https://ajax.googleapis.com/ajax/services/feed/load?v=2.0&q=http://phys.org/rss-feed/&num=20

Structure https://ajax.googleapis.com/ajax/services/feed/load?v=2.0&q=RSS_URL_TO_CONVERT&num=

Also if you want better control on RSS conversion use http://pipes.yahoo.com/pipes/ where you can visualize data flow.

EDIT: As yahoo pipes is no more working, here are the list of alternatives http://www.makeuseof.com/tag/12-best-yahoo-pipes-alternatives-look/

RSS is already in XML format, which is natively parsable by all browsers. I would recommend just parsing the XML directly instead of converting to json for parsing.

John Resig has a post about this:

http://ejohn.org/projects/rss2json/

I'd recommend using Yahoo Pipes to do this. You can simply pull the feed, and it acts as a proxy; JSONP is supported as well.

You could try using one of the many javascript libraries to navigate through the XML.

For example, here. There are many more libraries, here are the ones Google thought were good enough to host.

You can also try the Oxygen XML Editor (http://www.oxygenxml.com/). They offer a 30-day trial version and it's cross-platform. You can find the converter under Tools -> XML to JSON...

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!