[jdev] Re: weather data over Jabber
Trejkaz Xaoza
trejkaz at trypticon.org
Sat Jan 8 00:43:46 CST 2005
Peter Saint-Andre wrote:
> It seems that the (U.S.) National Weather Service has defined an open
> XML format for weather data:
>
> http://www.nws.noaa.gov/forecasts/xml/
>
> Perhaps a JEP (or some experimentation) is in order....
Some thought has been done on the matter. jabber.zim.net.au is the only
server I know of which actually runs a weather agent, and I've been thinking
of improving it for some time now.
Part of the problem with the existing XML weather formats is that there are
four of the damn things now, and that's just in the US. The other problem is
that their formats are completely unusable for our simpler needs, due to
complexity. Seriously, have a look at this file and tell me how comfortable
you'd be sending it around XMPP:
http://www.nws.noaa.gov/forecasts/xml/DWMLgen/schema/latest_DWML.txt
Wouldn't something like this be better?
<!-- Current conditions -->
<cc xmlns="http://jabber.org/protocol/weather">
<temp>25</temp>
...
</cc>
<!-- Forecast -->
<fc xmlns="http://jabber.org/protocol/weather"
date="...">
<mintemp>15</mintemp>
<maxtemp>30</maxtemp>
</fc>
In any case, I have a basic script banged together for the publishing end and
the subscribing end. These are the tiers which would be implemented if
everyone in the world were cooperative: ;-)
Relating to current conditions:
1. Have a bot routinely downloading from weather.com or some similarly
comprehensive weather site (weather.com have an XML format as well),
and push this data through pubsub.
2. Have "free" weather stations grab data from a weather station using
something like Open2300, publishing straight to pubsub.
Relating to forecasts:
1. Have a bot routinely downloading from weather.com or some similarly
comprehensive weather site (weather.com have an XML format as well),
and push this data through pubsub.
2. Have a bot subscribing to current conditions, which aggregates the
past conditions and uses them to calculate the forecasts. The
results would be pushed back up into a different pubsub channel.
Keeping the two separate is nice because not everyone gives a wet toss about
forecasts, and this way you can subscribe to either, or both.
So we need two data elements, one for current conditions and one for
forecasts, of which quite a few elements or datatypes will overlap. PubSub
is the easy choice for how to push them around, the more interesting thing I
can see in such a thing is how users will find the right PubSub feed.
Presumably you'd use service discovery and break down all the data by region,
so the user could browse into Oceania -> Australia -> New South Wales -> ...
TX
--
Email: Trejkaz Xaoza <trejkaz at trypticon.org>
Web site: http://xaoza.net/
Jabber ID: trejkaz at jabber.zim.net.au
GPG Fingerprint: 9EEB 97D7 8F7B 7977 F39F A62C B8C7 BC8B 037E EA73
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: not available
URL: <https://www.jabber.org/jdev/attachments/20050108/8e0f9ec8/attachment-0002.pgp>
More information about the JDev
mailing list