The National Weather Service provides Current Weather Conditions XML files for many cities in the US.
Here is some code for PHP5 (it uses SimpleXML) on doing this (assuming you’ve already grabbed the XML file from their site and have a way to cache it). It even has some code calculating the sunrise, sunset and civil twilight which PHP5 can do with date_sun_info() and since the XML file gives the date, latitude and longitude, you can calculate it dynamically.
//PHP5
if (file_exists('KADS.xml'))
{
$xmlstr = file_get_contents('KADS.xml');
$xml = simplexml_load_string($xmlstr);
$datetime = strtotime($xml->observation_time_rfc822);
$latitude = (float)$xml->latitude;
$longitude = (float)$xml->longitude;
$sun_info = date_sun_info(date('Y-n-j', $datetime), $latitude, $longitude);//calculate sunrise,sunset,...
echo '<ul id="current_conditions">';
echo '<li>' . date('l, F j, Y', $datetime) . '</li>';
echo '<li class="weather_loc">' . $xml->location . '</li>';
echo '<!--' . $xml->observation_time . '-->';
echo '<li><img src="' . $xml->icon_url_base . $xml->icon_url_name . '" alt="' . $xml->weather . '" /></li>';
echo '<li class="weather_temp"><strong>' . $xml->temp_f . '°' . '</strong></li>';
echo '<li class="weather_sum"><strong>' . $xml->weather . '</strong></li>';
echo '<li>Wind: <strong>' . $xml->wind_dir . ' ' . round($xml->wind_mph) . ' mph</strong></li>';
echo '<li>Humidity: <strong>' . $xml->relative_humidity . '%</strong></li>';
if ($xml->heat_index_f != 'NA')
echo '<li>Heat Index: <strong>' . $xml->heat_index_f . '</strong></li>';
if ($xml->windchill_f != 'NA')
echo '<li>Windchill: <strong>' . $xml->windchill_f . '</strong></li>';
echo '<li>Barometer: <strong>' . $xml->pressure_in . '"</strong></li>';
echo '<li>Visibility: <strong>' . $xml->visibility_mi . ' mi</strong></li>';
echo '<li>Dewpoint: <strong>' . $xml->dewpoint_f . '°</strong></li>';
echo '<li class="weather_credit">weather by <a href="' . $xml->credit_URL . '" title="' . $xml->credit . '">NOAA</a></li>';
echo '</ul>';
echo '<ul id="sunrise_sunset">';
echo '<li>Sunrise: <strong>' . date('g:i a', $sun_info['sunrise']) . '</strong> <span class="civil_twilight">Civil Twilight: <strong>' . date('g:i a', $sun_info['civil_twilight_begin']) . '</strong></span></li>';
echo '<li>Sunrise: <strong>' . date('g:i a', $sun_info['sunset']) . '</strong> <span class="civil_twilight">Civil Twilight: <strong>' . date('g:i a', $sun_info['civil_twilight_end']) . '</strong></span></li>';
echo '</ul>';
}
You will probably want to cache that output once you have it formatted how you like.