将 rss 转换为 JSON

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/670511/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-03 17:13:13  来源:igfitidea点击:

convert rss to JSON

jsonrss

提问by naren

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

craigslist 有一个 rss 提要,我希望将提要转换为 JSON 格式,以便我可以解析它。任何人都知道可以执行此操作的任何工具 - 将 craigslist rss(或任何 rss)转换为 JSON 格式

回答by naren

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.

更新:请注意,雅虎管道现已被雅虎关闭!并且 Google Feed API 已被弃用。检查superfeedr.com的 API,它也将 RSS 转换为 JSON。

You can use google feed api service

您可以使用 google feed api 服务

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=

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

此外,如果您想更好地控制 RSS 转换,请使用http://pipes.yahoo.com/pipes/,您可以在其中可视化数据流。

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/

编辑:由于雅虎管道不再有效,这里是替代列表 http://www.makeuseof.com/tag/12-best-yahoo-pipes-alternatives-look/

回答by bendewey

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.

RSS 已经是 XML 格式,所有浏览器都可以在本机解析。我建议直接解析 XML,而不是转换为 json 进行解析。

回答by BobbyShaftoe

John Resig has a post about this:

John Resig 有一篇关于这个的帖子:

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

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

回答by Jonathan Cutrell

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.

我建议使用 Yahoo Pipes 来做到这一点。您可以简单地拉取提要,它充当代理;也支持 JSONP。

回答by Jabba

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

您还可以尝试使用 Oxygen XML 编辑器 ( http://www.oxygenxml.com/)。他们提供 30 天的试用版,并且是跨平台的。您可以在Tools-> XML to JSON...下找到转换器

回答by cofiem

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

您可以尝试使用众多 javascript 库之一来浏览 XML。

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

例如,这里。还有更多的库,以下是Google 认为足以托管的库。