About WunderWeather Checker
What does it do?
Wunderground.com provides html code to allow users to put a weather
"sticker" of a city's forecast on his/her web page. WunderWeather
Checker takes the sticker concept a bit further and add some dynamic
flare.
WunderWeather Checker is a simple php script that allows you to retreive
weather information from www.wunderground.com quickly and easily. Simply
enter your city (cities with with multiple names only need a space to
separate; eg New Haven) and choose your state, and you will receive
a weather forecast for your selected city. The script can be run by
itself, or can be "included" or "required" in a
larger php script. The developer is in now way affiliated with wunderground.com,
nor is this project supported by wunderground.com
How does it work?
Wunderground.com uses a set infrastructure of paths and file names so
the personal weather stickers work. So the path to Hartford Connecticut's
forecast would be http://www.wunderground.com/us/ct/hartford.html, and
the path to the image banner for the sticker would be http://....www/US/CT/hartford.gif.
Different cities and different banner styles have different paths. When
you enter your city and state, WunderWeather Checker fills in all of
your information and adds it to the path to pull down the image and
create the link to the forecast.
Installation:
You can either access the script directly on your website - wunder.php,
or include in a larger php script.
Simply copy it to your web directory.
To include it in a larger script, follow these steps:
1) Rename your html page from file.html to file.php
2) Paste this into your html code where you would like weather checker
to appear:
<?php require ('wunder.php'); ?>
You must place wunder.php in the same directory as the script you added
this code to
3) To format it, treat the chunk of code like an image. To center it
do this:
<center> <?php require('wunder.php'); ?> </center>
|