[Tfug] tfug Digest, Vol 43, Issue 22

Eric G eric at nixwizard.net
Sun Feb 11 12:20:36 MST 2007


> Thanks to Stephen Hooper's clue, I found the problem in this line:
>
> if (preg_match("/<wind_mph>([0-9.]+)<\/wind_mph>/i",$weatherPage,$matches))
> {
>          $currentWindSpeed=$matches[1];
> }
>
> I forgot the . after the 0-9 and had an extra > after the second
> wind_mph.  So it wasn't parsing the data and without data for both
> WindDirection and WindSpeed, the program would just exit at that point.
>
> Hell to be old and blind.  ;-)
>
> Anyway, it works super now.  I can dial an extension on my Asterisk box
> and it downloads the latest weather info from
>
> <http://www.nws.noaa.gov/data/current_obs/KTUS.xml>
>
> parses it and plays it back.  Then she politely says goodbye and hangs up.
>
> George Cohn


I've gotta say that's a friggin awesome idea.... THAT'S why I'm on  
this list :-)

Put it on SourceForge.net :-)

-Eric





More information about the tfug mailing list