Archive for June, 2008

Creating a simple Weather.com / GeoIP mashup

Friday, June 6th, 2008

I just finished creating a simple Weather.com and GeoIP mashup.  All you need to do is register with Weather.com and go to their tools / website section.  Then you need to install GeoIP on your server.  Then you need to add the following source code:

$localzone = null;
if(geoip_db_avail(1))
{
 $localzone = geoip_record_by_name($_SERVER['REMOTE_ADDR']);
}
$zip = $localzone['postal_code'];

if(!isset($zip) || $zip ==null)
{
   echo “We could not find your zip code”;
   exit();
}

Mash it up with Weather.com’s source code and that’s it!

 Here is a quick sample

 Here is the source code