Tabbed rivers

116 views
Skip to first unread message

Dave Winer

unread,
Aug 5, 2012, 1:16:06 PM8/5/12
to river-...@googlegroups.com
I have four rivers that I like to keep an eye on, but I really only get to one on a regular basis.

Now I have a new "tabbed river" that combines all four into a tabbed interface.


It's an experiment, wanted to share it with you guys.

Dave

dodyg

unread,
Aug 29, 2012, 10:00:12 AM8/29/12
to river-...@googlegroups.com
Hi Dave,

Do you have any suggestion on how to deal with two different formats (JSON and JSONP) for a river subscription list?

Right now only  url attribute is available and that's to be used for JSONP format only. This is my OPML output  http://hobihobi.apphb.com/api/1/default/RiversSubscription?type=jsonp 

However for non JavaScript client such as hobihobi.apphb.com or mobile clients speak JSON only. Right now I have to resort on changing the query string http://hobihobi.apphb.com/api/1/default/RiversSubscription?type=json that will return links JSON sources. I think this is a workable workaround although I am looking for better idea.



Regards, 

Dody Gunawinata

Dave Winer

unread,
Aug 29, 2012, 10:02:00 AM8/29/12
to river-...@googlegroups.com
I am far from the expert on JSON and JSONP so I'd ask other people to comment on this.

Dave

dodyg

unread,
Aug 29, 2012, 10:28:43 AM8/29/12
to river-...@googlegroups.com
Let me re-clarify my question.

JSONP is required for JavaScript based river renderer like yours http://tabs.mediahackers.org/?panel=dave to deal with the cross domain data download. 

Your produces both formats for your river.

<outline text="Apple River" title="Apple River" type="river" name="apple" url=" http://static.scripting.com/houston/rivers/apple/River3.js"/>  JSONP

<outline text="Apple River" title="Apple River" type="river" name="apple" url="http://static.scripting.com/houston/rivers/apple/apple.json"/> JSON


Now how should I handle this for the OPML subscription list. There are two different formats for a single river which servers two different client (JavaScript and the rest).

One way to do it is to mimic from RSS Opml list and do as follows:

<outline text="Apple River" title="Apple River" type="river" name="apple" jsonUrl="http://static.scripting.com/houston/rivers/apple/apple.json" jsonpUrl=" http://static.scripting.com/houston/rivers/apple/River3.js"/> 

Dave Winer

unread,
Aug 29, 2012, 10:32:37 AM8/29/12
to river-...@googlegroups.com
Okay now I understand.

Use the JSONP version, because that's what I'm doing.

That way our OPML will be the same. :-)

I don't think there's any right or wrong way to do this. But you have to pick one and stick with it. 

If there's a crying need for both, we can add that as an attribute, but let that be driven by demand.

Right now it's just you and me.

Dave

Dave Winer

unread,
Aug 29, 2012, 10:34:14 AM8/29/12
to river-...@googlegroups.com
Except the names of your attributes are not the same. I did spell this out in the comments.

Please, this is not a good place to be creative. Interop. Please.

I will post some pointers to examples to the list. I'm finishing up another project right now and this was going to be the next area I worked in anyway.

Dave

dodyg

unread,
Aug 29, 2012, 10:55:33 AM8/29/12
to river-...@googlegroups.com
No worries - my aim is for 100% interoperability. I will remove the JSON only feed and stick with JSONP only approach.

Dave Winer

unread,
Aug 29, 2012, 11:02:28 AM8/29/12
to river-...@googlegroups.com
Great!


That's the writeup with an example of the OPML and a rendering.

Dave

dodyg

unread,
Aug 29, 2012, 12:01:26 PM8/29/12
to river-...@googlegroups.com
Thanks. I've updated my code and now it's JSONP only  http://hobieu.apphb.com/api/1/default/riverssubscription. It's rendered at  http://hobieu.apphb.com/. My next task is to allow people to create their own tabbed rivers online.
Reply all
Reply to author
Forward
0 new messages