Home >  Archive >  2011 >  February >  9

Previous / Next

A river of news in JSON
By Dave Winer on Wednesday, February 09, 2011 at 8:20 PM.

Way back in December 1997, I wrote about Scripting News in XML. "One of the promises of XML is that it will make it possible to have different kinds of browsers, custom-built to present specialized content flows." #

A picture named angryNerd.gifAnd while some angry nerds (heh) will disagree, for sure -- that was the beginning of RSS. The first moment a blog post crawled up on an aggregator and said Hello World.  #

So maybe what I am about to show you now will also lead to some big things? I think it will. :-) #

Here's the deal. #

I like to read my news in what I call a river. It's a very simple idea. Read a feed. If there are any new items put them on a raft and float them down the river. Read another feed, etc etc. Yadda yadda. Over and over, for all time.  #

If you like Twitter or Facebook, it should sound familiar. Of course rivers existed before Twitter and Facebook, as many people will point out. A teletype is a river. The first websites were rivers, as are all blogs. It's a natural step to make our RSS readers work the same way.  #

For example, here's how I read my news. #

http://daveriver.scripting.com/ #

Now if you pop the hood, and view source on that page, you'll see that it's a JavaScript application that gets its data from a JSON file. #

http://daveriver.scripting.com/river3.js  #

It's called river3.js because it's the third version of the format. I hacked it out with a wonderful group of jQuery programmers on the River of News mail list. Also it's what I call static JSONP. The name of the procedure that it calls is fixed at onGetRiverStream. It means that you have to have a local handler with that name that will render the content. That's the extent of my limited knowledge of how jQuery apps work. But I love the way it works, as a user, and I like the clarity of the format we use to exchange the data.  #

If you look at that file, you'll see what a river looks like in code. #

As with RSS, it's so simple that you could almost read it without an application. I hope all the names of elements make sense. I strived for simplicity and obviousness.  #

If you want to build an application that reads this river, please do. Try to read it no more often than once every ten minutes. To read it more often is pointless, that's how often it changes. And don't be shy, if you develop something using this data, show us what it looks like... #

Here we go again! :-) #




Christmas Tree
This site contributes to the scripting.com community river.


© Copyright 1997-2011 Dave Winer. Last update: Wednesday, February 09, 2011 at 8:28 PM Eastern. Last build: 12/12/2011; 12:56:53 PM. "It's even worse than it appears."

RSS feed for Scripting News

Previous / Next