Slashdot Mirror


Weather Data Available in XML

wombatmobile writes "Wired reports the National Oceanic and Atmospheric Administration this week began providing weather data in an open access XML format. Previously, the data was technically available to the public, but in a format that's not easily deciphered. How will the free and easy availability of valuable data like this in XML affect the development of the web? One example is Tom Groves SVG weather. This type of visualization of XML data is about to fall within easy reach with nothing more than a text editor required as an authoring tool. From March 2005 SVG becomes part of the standard Mozilla/FireFox build. As an example of how web standards are supposed to work, what more could you hope to find?" We mentioned the policy change a few days ago.

4 of 198 comments (clear)

  1. The question is..... by BorisSkratchunkov · · Score: 5, Funny

    weather or not I'll use it.....

    I'm sorry, I'm sorry....it's another bad pun....I seriously need to talk to a psychologist about my BPS (Bad Pun Syndrome or Backup Power Supply, which ever you prefer).

  2. Re:What's my lat and alt? by Anonymous Coward · · Score: 5, Informative

    Click on a city in your area on this site: http://www.timeanddate.com/worldclock/custom.html? continent=namerica The page for each city lists the coordinates.

  3. Re:Next step, better forecasting by LiquidCoooled · · Score: 5, Funny

    The NOAA today started releasing accurate targeted weather data in XML format to a wide audience.
    However unfortunately, because of a large slashdotting, you cannot get todays weather until tomorrow.
    Several planned hurricanes were put on hold for a few days because of the disruption.
    Impatient internet users were caught and fined for illegally downloading and sharing todays weather. One user had a large tornado and numerous thunderstorms on his server.

    --
    liqbase :: faster than paper
  4. weather.com been doing this for a while by Fishstick · · Score: 5, Informative
    I set up a little script a long time ago to get weather data from an XML feed from the weather channel for our office webcam. It's free and was really easy to use...

    http://www.weather.com/services/xmloap.html?
    #!/usr/local/bin/perl -w
    require LWP::UserAgent;
    use XML::DOM;
    use CGI qw(:standard);
    # first, get the XML feed
    my $ua = LWP::UserAgent->new(env_proxy => 1, keep_alive => 1, timeout => 30);
    my $base_url="http://xoap.weather.com/weather/local/6 0143?cc=*&prod=xoap";
    my $par="&par=[removed]";
    my $key="&key=[sign up to get one]";
    $response = $ua->get("$base_url$par$key");
    die "Error while getting ", $response->request->uri,
    " -- ", $response->status_line, "\nAborting"
    unless $response->is_success;
    my %weather = %$response;
    # then, parse out the crap we want
    my $parser = XML::DOM::Parser->new();
    foreach(keys %weather){
    $xmldoc = $parser->parse($weather{$_}) if(/content/);
    }
    foreach my $cur_cond ($xmldoc->getElementsByTagName('cc')){
    $curr_cond{'lastup'} = $cur_cond->
    getElementsByTagName('lsup')->item(0)->
    getFirstChild->getNodeValue;
    $curr_cond{'obsvst'} = $cur_cond->
    getElementsByTagName('obst')->item(0)->
    getFirstChild->getNodeValue;
    $curr_cond{'temp'} = cur_cond->
    getElementsByTagName('tmp')->item(0)->
    &nb s p; getFirstChild->getNodeValue;
    $curr_cond{'chill'} = $cur_cond->
    getElementsByTagName('flik')->item(0)->
    getFirstChild->getNodeValue;
    $curr_cond{'text'} = $cur_cond->
    getElementsByTagName('t')->item(0)->
    getFirstChild->getNodeValue;
    $curr_cond{'icon'} = cur_cond->
    getElementsByTagName('icon')->item(0)->
    getFirstChild->getNodeValue;
    }
    print header;
    print start_html("nice little cgi page to display the time/weather");
    print <<EOF;
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p >
    <p><font size="-1">WebCam is located on 9th floor in Itasca<br />
    pointed out southeast window overlooking Thorndale</font></p>
    <form name="clock" onSubmit="0">
    <input type="button" name="face" size=13 value="">
    </form>
    EOF
    print end_html;


    sorry about the atrocious formating - slashcode made me take out whitespace (what is the fricking point of an ecode tag supported if you can't post a small snippet like this without removing all the whitespace!?)

    --

    There is much cruelty in the universe, John.
    Yeah, we seem to have the tour map.