This part of the thread seems headed for dev, so I'm migrating it there.

On 2/4/07, Johan Sundström <[EMAIL PROTECTED]> wrote:
> On 2/4/07, Steve Dunham <[EMAIL PROTECTED]> wrote:
> > I tweaked the loadGoogleSpreadsheetsData() function to create a
> > loadGoogleBaseData() so I could create Exhibits using Google Base.
>
> Neat! I've been waiting for someone to add another JSONP source or two
> so it makes more sense refactoring up a generic JSONP loader (so they
> can share most of the code).
>
> I'd also love to see someone interact with some Yahoo JSONP feed, by
> the way -- they are less contrived and should be easier to work with
> too.

I crafted the present GoogleSpreadsheets loader into a generic JSONP
loader tonight and thought I'd toss in your Google Base converter to
plug into it next, after a peek at the Flickr API. My past experiences
with the Del.icio.us JSONP API (now acquired by Yahoo) had me hoping
they would be something similarly beautful, which they were not;
loadJSONP will need another work-through before it's quite generic
enough, at least to run with the Flickr API (which requires MD5 hashed
signatures of all query parameters, up to and including the JSONP
callback name).

Doing things with the Flickr API also seems to require users to click
acceptance on a page over at  Flickr, be redirected to a page
controlled by the owner of the API key used, and then that page has to
iterate back and forth at least two rounds of JSONP callbacks before
having any data to work with. (The Terms of Service are about as much
fun.)

Current API looks like

  exhibit.loadJSONP( url_or_urls, fConvert, fDone );

where the last two are optional and the first is an url or array urls
to load, the second a function to transform the json given into one
containing an Exhibit {items:, properties:, types:} object, and the
third some callback to run after completion. This will surely get
extended additionally, but I think it is a decent start that should
remain functional even after my updates.

If the JSONP service of your pick is really JSONP compliant (for
instance naming its callback parameter "callback"), you don't need to
think about decorating the url with that. For the other cases I
believe there may be forthcoming API changes still.

-- 
 / Johan Sundström, http://ecmanaut.blogspot.com/

_______________________________________________
General mailing list
[email protected]
http://simile.mit.edu/mailman/listinfo/general

Reply via email to