Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I serve RSS in JSON?

Tags:

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, as published on the World Wide Web Consortium (W3C) website.

Obviously this means that I am not serving 'pure' RSS if I choose the JSON option. That said, if I conform to the rest of the spec, is it likely that (customised) readers will be able to parse it?

To put it another way, if I conform to the spec, but using JSON instead of XML is it a usable RSS feed?

edit I am not sure I made myself clear. There is no XML involved. I want to write something akin to RSS (which is XML) using JSON instead. Obviously the readers of such a feed would need to be written to understand the JSON format. I was wondering if this had been done already. Are there services that serve a feed this way? Are there programs that can aggregate/understand this format. Is the RSS spec (sans the XML part) a useful spec to conform to in this case?

rg

{ "title":"example.com", "link":"http://www.example.com/", "description":"Awesome news about junk", "items":[     {         "title":"An article",         "link":"http://www.example.com/an-article",         "descrition":"Some sample text here",         "pubDate":"2008-10-27 11:06 EST",         "author":"example author",     },     {         "title":"Second",         "link":"http://www.example.com/Seond",         "descrition":"Some sample text here",         "pubDate":"2008-10-25 23:20 EST",         "author":"author mcauthor",     },     {         "title":"third article",         "link":"http://www.example.com/third-article",         "descrition":"Some sample text here",         "pubDate":"2008-10-25 23:18 EST",         "author":"some other author",     } ] }  
like image 263
Doug Miller Avatar asked Oct 29 '08 12:10

Doug Miller


People also ask

What is RSS JSON?

JSON Feed is a Web feed file format for Web syndication in JSON instead of XML as used by RSS and Atom.

Is RSS in XML format?

RSS is a Web content syndication format. Its name is an acronym for Really Simple Syndication. RSS is a dialect of XML. All RSS files must conform to the XML 1.0 specification, as published on the World Wide Web Consortium (W3C) website.

Can JSON be used with soap?

SOAP can use JSON for communication, but the reverse is not at all possible. SOAP uses XML format, whereas JSON uses a key-value pair. The error message can be declared with SOAP, but the same is not possible with JSON. Comparison between JSON vs SOAP.


1 Answers

No, RSS is an XML-based format, and JSON is an different language rather than some kind of dialect. RSS readers won't understand JSON.

Your question is akin to asking 'Can I speak French in Chinese?'

like image 108
Gareth Avatar answered Oct 05 '22 07:10

Gareth