src/cm/media/js/lib/yui/yui3.0.0/examples/io/assets/weather.php
author raph
Thu, 10 Jun 2010 14:56:36 +0200
changeset 280 4f3002c6eab7
parent 0 40c8f766c9b8
permissions -rw-r--r--
initialize the user registration language code to request.LANGUAGE_CODE (selected language or default setting)

<?php
/* yadl_spaceid - Skip Stamping */
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");

// always modified
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");

// HTTP/1.1
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Content-Type:text/xml");

$url = 'http://xml.weather.yahoo.com/forecastrss?'.getenv('QUERY_STRING');

function getResource($url){
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        $result = curl_exec($ch);
        curl_close($ch);

        return $result;
}

$feed = getResource($url);
echo $feed;
?>