Newsgroup: it.lavoro.professioni.webmaster
Titolo: RePOST: Esiste un servizio FREE Meteo.

Mi scuso per il precedente post.
Provo a riformularlo :
Esiste un servizio FREE di meteo da poter mettere sul mio sito ?
Grazie


http://weather.noaa.gov/
Maharet

 ha scritto nel messaggio
news:7GT_8.99295$Jj7.2...@news1.tin.it...


ESISTE!!!!!!!!!!!
(leggi il post di Maharet)
Li trovi sotto
http://www.hotscripts.com/PHP/Scripts_and_Programs/Web_Fetching/
 (con
weather)

How to put weather on your site for free
A lot of Webmasters would like to provide weather forecasts on their sites,
but can't afford to pay to get it from a service like Accuweather. If you're
looking to get weather on your site for free, look no further; PHP and the
National Weather Service make this a reality. In this tutorial you will
learn how to find your area's weather forecast on the National Weather
Service site, parse it with PHP and format it for inclusion into your site,
all absolutely free.
First go to the NWS site at 
weather.noaa.gov
 and select your state from the
drop-down menu under "United States Weather." Once you are on the page for
your state, select either your county or city from the drop-down menus under
the "Forecasts, watches and warnings" section. This will take you to the
"Current Conditions, Forecasts, Watches and Warnings" page for your city or
county. (My city's page is located at 
http://weather.noaa.gov/cgi-bin/
iwszone?Sites=:alz023.) This is the page from which you will get your
forecast information, so remember the URL.
We want the zone forecast , so we'll use PHP to grab it off the page and
replace the NWS's HTML formatting with our own. First, we select only the
part of the page between the "ZONE FORECASTS" and the anchor used to mark
the state forecast section, which is immediately below the zone forecasts.
We do this using the following piece of code:
<?
$url = "
http://weather.noaa.gov/cgi-bin/iwszone?Sites=:alz023
";
$StartPattern = "ZONE FORECAST";
$EndPattern = "<a name=\"t3\">";
$fd = fopen( $url, "r" );
$contents = fread( $fd, 20000 );
fclose( $fd );
if(eregi("$StartPatten(.*)$EndPattern", $contents, $parsepart)) {
$ContentPart=$parsepart[1];
}
?>
Now that you have just the forecasts selected, you need to stript the HTML
formatting and replace it with your own using regular expressions. While it
might be tempting to just strip all the HTML tags out, we need to remove
them in a certain order to make the process work right. We strip the HTML a
little bit at a time and replace it with pseudo-XML tags. Then we can
perform further regular expression substitutions to replace the pseudo-XML
tags with HTML tags. This code works the transformation and writes it out to
a browser:
<?
$ContentPart = preg_replace ("/<B>(.*?)>/", "[head]", $ContentPart);
$ContentPart = preg_replace ("/<\/FONT><\/B>/", "[endhead]", $ContentPart);
$ContentPart = preg_replace ("/(.*?)20\d\d/s", "", $ContentPart);
$ContentPart = preg_replace ("/<(.*?)>/", "", $ContentPart);
$ContentPart = preg_replace ("/\n/", " ", $ContentPart);
$ContentPart = preg_replace ("/EXTENDED FORECAST/", "", $ContentPart);
$ContentPart = preg_replace ("/\[endhead\]/", "</b>\n<br><i>",
$ContentPart);
$ContentPart = preg_replace ("/\[head\]/", "</i>\n<!--end day
forecast-->\n<br><!--start day forecast-->\n <b>", $ContentPart);
$ContentPart = "UTILITYPATTERN" . $ContentPart;
$ContentPart = preg_replace ("/UTILITYPATTERN(.*?)end day forecast-->\n/s",
"", $ContentPart);
$ContentPart .= "</i>";
$ContentPart = preg_replace ("/<!--start day forecast-->\n <b><\/b>(.*?)end
day forecast-- >\n<br>/ms", "", $ContentPart);
echo $ContentPart;
?>
The code above gives this result:
TODAY
MOSTLY SUNNY. HIGHS AROUND 95. WEST WINDS 5 TO 10 MPH.
TONIGHT
PARTLY CLOUDY. LOWS AROUND 70. LIGHT AND VARIABLE WINDS.
MONDAY
PARTLY CLOUDY WITH AN ISOLATED AFTERNOON AND EVENING SHOWER OR THUNDERSTORM.
HIGHS IN THE MID 90S. SOUTHWEST WINDS AROUND 5 MPH. CHANCE OF RAIN 20
PERCENT.
MONDAY NIGHT
MOSTLY CLOUDY WITH AN ISOLATED SHOWER OR THUNDERSTORM. LOWS AROUND 70.
CHANCE OF RAIN 20 PERCENT. .TUESDAY....PARTLY CLOUDY WITH A CHANCE OF
SHOWERS AND THUNDERSTORMS. HIGHS 85 TO 90. CHANCE OF RAIN 40 PERCENT.
WEDNESDAY AND THURSDAY
MOSTLY CLOUDY WITH A CHANCE OF MAINLY AFTERNOON AND EVENING SHOWERS AND
THUNDERSTORMS. LOWS 65 TO 70. HIGHS 85 TO 90.
FRIDAY AND SATURDAY
MOSTLY CLOUDY WITH A CHANCE OF MAINLY AFTERNOON AND EVENING SHOWERS AND
THUNDERSTORMS. LOWS IN THE MID 60S. HIGHS 80 TO 85.
You can play with the HTML tags in the code above to get the look you want.
Now that you understand how this script works, you can modify it to
integrate other content into your site
(preso dalla cache di google poichè la pagina non esiste +)
http://216.239.35.100/search?q=cache:2qgqrdnZY-IC:www.alexanderdevelopment.n
et/scripting/php/tutorials/nws.php+
http://weather.noaa.gov
+php&hl=en&ie=UTF-
8

vai qui 
http://phpweather.sourceforge.net/

> Non ti scusare, tu avevi scritto bene. :)
non ho capito bene quel "tu".... ;) mi devo scusare io? ;)
Ok.... SCUSATEMI.... contenti? ;)

in ASP?
purtroppo l'unico in hotscript non funziona (è scritto sul sito ufficiale)
quindi te lo devi fare a mano :( leggiti il mio post in inglese che spiega a
come farlo in php e convertilo in asp. Purtroppo non ti posso dare grandi
aiuti :(

usa
This code can fetch a web page from any website and gives the HTML as
output. No third party components or DLL's are made use. Its a pure ASP
code.
http://www.hotscripts.com/cgi-bin/dload.cgi?ID=15547
ti dovrebbe servire