convert rss to JSON [closed]

偶尔善良 提交于 2019-12-29 03:21:47

问题


craigslist has an rss feed and i wish to convert the feed to JSON format so that I can parse it. anybody know any tool that can do this - convert craigslist rss (or any rss) to JSON format


回答1:


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/




回答2:


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.




回答3:


John Resig has a post about this:

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




回答4:


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.




回答5:


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.




回答6:


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



来源:https://stackoverflow.com/questions/670511/convert-rss-to-json

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