Can I serve RSS in JSON?

后端 未结 9 528
别那么骄傲
别那么骄傲 2020-12-24 02:34

I am writing an RSS feed (for fun) and was looking at the spec here.

RSS is a dialect of XML. All RSS files must conform to the XML 1.0 specification,

相关标签:
9条回答
  • 2020-12-24 03:28

    Are there programs that can aggregate/understand this format.

    You can use XSLT 3.0 to transform XML to JSON and back to XML again. More info on how to accomplish the transforms to JSON here:

    https://www.xml.com/articles/2017/02/14/why-you-should-be-using-xslt-30/.

    0 讨论(0)
  • 2020-12-24 03:31

    You're right that the client reading the feed would have to have custom support for whatever the particulars of your JSON were. So you'd either need to make a custom feed reader to consume that information, or someone would have to propose a JSON feed standard, and it'd have to be widely adopted.

    Well, I think your desires have finally been met, friend!

    Take a look at JSON Feed. As of this writing it's only about a week old, but it's already picking up steam, having been supported now by Feedly, Feedbin, News Explorer, NewsBlur, and more being added all the time.

    If I had to pick a standard to use when generating a JSON version of RSS, I'd pick JSON Feed for sure.

    0 讨论(0)
  • 2020-12-24 03:34

    Is the RSS spec (sans the XML part) a useful spec to conform to in this case?

    If you want to invent yet another syndication format, I recommend using Atom as a base. IMHO it has much cleaner, more consistent design, and has useful features like reliable updates of past items, makes distinction between summaries and full content, etc.

    I was wondering if this had been done already.

    Flickr has JSON output format. They even have lolcode feed.

    0 讨论(0)
提交回复
热议问题