Example #1
0
<?php

function error($msg)
{
    return '<span style="font-size:10px;font-weight:normal;">' . $msg . '</span>';
}
$city = isset($_GET['loc']) ? $_GET['loc'] : '';
$deg = isset($_GET['deg']) ? $_GET['deg'] : 'c';
if (empty($city) || stristr($deg, 'DEGREE') || stristr($city, 'location')) {
    $out = error('read the readme!');
} else {
    require './get_weather.php';
    $api = new GetWeather($city, $deg);
    $res = $api->get_degree();
    if (empty($res)) {
        $out = error('ur doin somthn wrng');
    } else {
        file_put_contents($api->cache, $res);
        $out = $res . '&deg;';
    }
}
// Extra Options:
$refresh = isset($_GET['refresh']) && $_GET['refresh'] >= 60 * 30 ? $_GET['refresh'] : 60 * 30;
$ext_stylesheet = isset($_GET['style']) ? $_GET['style'] : '';
$font = isset($_GET['font']) ? $_GET['font'] : 'Helvetica Neue';
$font_color = isset($_GET['color']) ? $_GET['color'] : 'fff';
$font_size = isset($_GET['size']) ? $_GET['size'] : '20';
$opacity = isset($_GET['opacity']) ? $_GET['opacity'] : '1';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">