Yahoo Weather PHP parser

17.04.2012

Yahoo is offering a simple XML feed that is constantly updated, offering weather data like weather conditions, maximum and minimum degrees in both Celsius and Fahrenheit measure units, wind speed, atmospheric pressure, sunrise and sunset time, humidity in percents, forecast for tomorrow (weather conditions, maximum and minimum degrees), and a small picture representing the current weather conditions.

Download our Yahoo weather PHP parser from here.

The .zip archive contains two files, the .SQL database that will be imported into phpmyadmin and the .php file that is the parser.

The only things that should be edited inside the .php file are the city code, you can retrieve the codes by searching for cities on the official Yahoo weather website.

The numbers from the URL is the code that you need to replace inside the .php file (“w=2442047&u=c” is for Los Angeles while “u=c means Celsius”, replace “c” with “f” to obtain the values in Fahrenheit.

Create a cronjob that will run every 30 minutes at least.

Some basic PHP skills are required to modify and use this script.

Yahoo weather








Leave a Reply

*
*