Re: Iconize weather info and something else
Brought to you by:
iridium
From: Martin G. <gim...@gi...> - 2002-02-07 11:28:16
|
"Ray van Beek" <r_v...@ho...> writes: > Hi all, > > I am interested in showing some simple icons that indicate > cloud/sun/rain/snow etc, as you can see on portals, sites of > newspapers etc. Is somebody engaged in this? Well, there has been some people working on this, but I haven't received any code that solves the problem. The problem is (as I see it) that there isn't a field in the METAR that tells you if the weather is good or bad. You'll have to combine the information, and either select an appropriate image from a huge list of ready-made images, or perhaps generate the image on the fly using the GD library from within PHP. > The other thing is more a suggestion. The account I have is on a > rather slow server. This means that when someone is requesting the > page with the phpweather script, it can take a long time before the > requested page is showing. The script first need to get the METAR > data from the noaa site. Then the page generated. Then the page is > sent to the one that requested the page. Would it be possible to > have the script responded right away by showing the complete page > but with a remark like 'Retrieving METAR data ... please wait'? Then > when the script has received and processed the METAR data, the > remark is replaced by the actual data. That would be very cool - but how should that be done in HTML? It might be possible to do this by using JavaScript or Java. > In general, during the time the METAR data has not been received and > processed, some indication should be shown that shows this status. > After processing, the indication is replaced with the actual data. > Would that be possible? It's difficult to make HTML pages respond to things happening at the server, after the page is loaded, as a HTTP request for a page is stateless: you request a page, the webserver sends it to you, and that's it. The browser doesn't communicate any further with the server about that particular page. It could be possible to make some JavaScript or another widely used language runs at the client, that would be ask the server for the weather information after the page has been rendered with the 'Please wait...' text. But I think it would be difficult to make this reliable and cross- platform. -- Martin Geisler My GnuPG Key: 0xF7F6B57B See my homepage at http://www.gimpster.com/ for: PHP Weather => Shows the current weather on your webpage. PHP Shell => A telnet-connection (almost :-) in a PHP page. |