Hi TG users and developers,

I have a TG application which presents weather forecasts for users.
The novelty of the application is that it is actually extracting data
from the meteorological forecast data files and plotting the forecasts
when the user requests it. This allows for example users to extract a
weather forecast along a route they plan to follow or a time series
interpolated to the exact point that the user wants. So far the only
way to use this is through my own web pages (in testing):

http://www.worldwildweather.com

I think these data could be used in a lot of different situations (for
example route planning software could plot the weather along the route
with high accuracy). I have therefore decided some time ago to make
the data and plots available through a HTTP request with TG returning
a JSON response. This interface is more or less finished. I am however
lacking one important detail.

Web developers who wants to access this service using Javascript on
the client side cannot do so directly due to the Javascript security
model (server side you can of course access it using whatever language
you want). There are however methods for developers to access
"trusted" remote sites. I believe a good and and widely adapted (by
Javascript libraries as far as I understand) solution is the one
proprosed by Bob Ippolito. This solution is named JSONP for JSON with
Padding and requires a small server side modification. What needs to
be done is basically to wrap the output JSON in parantheses and if
jsonp is present as a query argument to insert the text value from
that before the first (. Or to put it differently: If jsonp=mycallback
- then the response should be:

mycallback(output_json)

and if jsonp is not specified it should return:

(output_json)

http://bob.pythonmac.org/archives/2005/12/05/remote-json-jsonp/

Before reinventing the wheel I wanted to ask you if anyone has already
done this work? If not I could sure use some recommendations on how to
proceed.

Best regards,
Jesper
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to