[wp-hackers] JSON Syndication

Matt Patenaude MattPat at mattpat.net
Wed Feb 21 00:51:49 GMT 2007


I'm not trying to knock XML as a language. XML is very powerful, and  
I believe that there are many places (particularly in rich documents)  
where its uses are plentiful. However, I don't think syndication is  
one of them.

> Please consider the needs of full text feeds with embedded markup.  
> Once you do that JSON's no longer so simple.

And what exactly are the needs of full text feeds? I think that  
matter is up to interpretation, but the way I see it, the entire  
purpose of online syndication is to distribute a snippet of a larger  
work in a format that piques the reader's interest, and encourages  
them to visit the original source to read more. I do not see  
syndication having the need to convey all of the semantic markup of  
the document being syndicated. When I read an Atom feed, I honestly  
don't really care where the author put emphasis. If I want that much  
info, I'll click the link and read the whole article.

The format that's doing the syndication is only a container-- RSS is  
a container, Atom is a container, and this JSON feed format would  
also be a container. What would go in the content section could be  
anything you want, just like Atom. I would probably add a type  
property to each entry, so that you could specify if the content was  
text/html, text/plain, or even something a little fancier. Find me an  
Atom feed that can't be represented by JSON... bet it won't be easy.  
There's no saying a JSON feed couldn't handle embedded markup (in  
fact, I had always intended it to).

Of course, syndication is no use if it's ridiculously hard to  
implement. I'm not saying that XML is all that bad, but JSON is much  
simpler. Since JSON relates directly to programming data structures,  
it's easier to handle and deliver to the people who want to read it.

> The syndication format I see there is much simpler than what people  
> are sending today with Atom.

Well see, that's interesting, because I copied the most commonly used  
elements from the Atom standard and just turned it into JSON.

> Yeah, I think he's probably confusing a particular schema with XML.

For the record, no, I was not. If I simply had a distaste for an XML  
schema, I would have proposed a new schema, not a new method. ;)

> And I'm not even talking about the inevitable security bugs that  
> are going to open up if people begin executing JavaScript code that  
> syndicators send them.

A JSON feed shouldn't contain any JavaScript code whatsoever. In  
fact, I think the callback feature of JSON should not be implemented  
by scripts generating JSON feeds. Further, it will be encouraged (in  
big bold letters ;)) that people using the feeds use a JSON  
interpreter, rather than just eval()'ing it. That eliminates pretty  
much every problem.

I'm not giving up just yet, I still think JSON has a lot of promise  
as a syndication container. Thanks a lot for the input though! :)

-Matt


More information about the wp-hackers mailing list