#!/usr/bin/perl
use LWP::Simple;


$myKey = "xxx";
$zip = 20742;
$file = get "http://api.openweathermap.org/data/2.5/weather?zip=$zip,us&APPID=$myKey&mode=xml";

if($file =~ /sun rise="([^"]+)" set="([^"]+)"/) {


	($sunRiseDate,$sunRiseTime)=split(/T/,$1);
	($h,$m,$s)=split(/:/,$sunRiseTime);

	($sunSetDate,$sunSetTime)=split(/T/,$2);
	($hs,$ms,$ss)=split(/:/,$sunSetTime);

	$h = $h - 5;
	$hs = $hs - 17;


	$text = "The sunrise today in College Park, MD is at $h:$m am and sunset is at $hs:$ms pm";
	print $text;	
}