extract by delimiter

Nonsanity rev at nonsanity.com
Tue Dec 28 23:12:19 CST 2010


I've tested both Yahoo and Google's (undocumented) REST APIs for weather,
but settled on NOAA's:

http://www.weather.gov/forecasts/xml/sample_products/browser_interface/ndfdXMLclient.php?lat=38.99&lon=-77.01&product=glance&begin=2010-12-28T00:00:00&end=2011-01-03T00:00:00<%20http://www.weather.gov/forecasts/xml/sample_products/browser_interface/ndfdXMLclient.php?lat=38.99&lon=-77.01&product=glance&begin=2010-12-28T00:00:00&end=2011-01-03T00:00:00>

Note that first the output defines one or more time series with a name like
"k-p24h-n5-1", then has sections for each of the results. The URL above uses
the "glance" setting, so it always gives the same result categories. The NOAA
page on the API <http://www.weather.gov/forecasts/xml/rest.php> goes into
more detail about what other data types you can fetch.

The thing to note is that the time series name is human readable. "p24h"
means 24 hours per sample, and "n5" means 5 samples.

Nice thing is, it takes raw lat/lon. No conversion to zip code or other
location metric. I've already got a nice temp chart going. Just don't fetch
the data more than once an hour in the final product - There's no point, as
it only updates once per hour on the 45's.

 ~ Chris Innanen
 ~ Nonsanity



On Tue, Dec 28, 2010 at 11:12 PM, Thomas McGrath III <mcgrath3 at mac.com>wrote:

> By the way I tried all of the examples posted to better see what I was
> missing. I'm a visual oriented person and so I went with steps I could see.
> Only one problem in removing leading spaces, I took the lazy way out after
> getting confused again with multiple repeat loops etc.
>
> So here is what I decided to use for now:
>
> on mouseUp
>        put "http://weather.yahooapis.com/forecastrss?w=22664069&u=f" into
> tTempURL
>        put url tTempURL into field "Source"
>        put field 1 into tTemp
>        filter tTemp with "*yweather:*"
>        replace "<" with "" in tTemp
>        replace "/>" with "" in tTemp
>        replace "yweather:" with "" in tTemp
>        replace quote&space with quote&cr in tTemp -- Did the trick
>        repeat for 5 -- Lazy way to catch leading spaces
>                repeat with x = 1 to the number of lines in tTemp
>                        if char 1 of line x of tTemp is space then delete
> char 1 of line x of tTemp
>                        if line x of tTemp is quote then delete line x of
> tTemp
>                        if line x of tTemp is "" then delete line x of tTemp
>                end repeat
>        end repeat
>        if last line of tTemp is "" then delete last line of tTemp
>        put tTemp into field "Result"
> end mouseUp
>
> I don't mind the quotes in the Result for my other code and I get a nice
> list of the info I need.
>
> Now I need to write a LAT LON converter to WOEID and or a ZIP Code to WOEID
> (Yahoo ID scheme)
>
> w=22664069 is for Bethel Park PA
>
>
> -- Tom McGrath III
> http://lazyriver.on-rev.com
> 3mcgrath at comcast.net
>
> On Dec 28, 2010, at 7:50 PM, Mark Wieder wrote:
>
> > Jeff-
> >
> > Tuesday, December 28, 2010, 4:47:02 PM, you wrote:
> >
> >> So, most others have sent you excellent suggestions. I just find
> >> it funny that the little town you mention just happened to be the
> >> place I was born. ;-)
> >
> > You could probably save Tom a lot of trouble if you just tell him what
> > the weather's like...
> >
> > --
> > -Mark Wieder
> > mwieder at ahsoftware.net
> >
> >
> > _______________________________________________
> > use-livecode mailing list
> > use-livecode at lists.runrev.com
> > Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-livecode
>
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>


More information about the use-livecode mailing list