コード例 #1
0
ファイル: asi.php プロジェクト: muthulatha/iem
// End of download_data
$syear = isset($_GET["syear"]) ? $_GET["syear"] : date("Y", time() - 86400);
$eyear = isset($_GET["eyear"]) ? $_GET["eyear"] : date("Y", time() - 86400);
$emonth = isset($_GET["emonth"]) ? $_GET["emonth"] : date("m", time());
$eday = isset($_GET["eday"]) ? $_GET["eday"] : date("d", time());
$smonth = isset($_GET["smonth"]) ? $_GET["smonth"] : date("m", time() - 86400);
$sday = isset($_GET["sday"]) ? $_GET["sday"] : date("d", time() - 86400);
$ehour = isset($_GET["ehour"]) ? $_GET["ehour"] : 0;
$shour = isset($_GET["shour"]) ? $_GET["shour"] : 0;
$station = isset($_REQUEST['station']) ? $_REQUEST['station'] : 'ISU4003';
$imguri = sprintf("asi_plot.py?station=%s&syear=%s&smonth=%s&sday=%s&shour=%s&eyear=%s&emonth=%s&eday=%s&ehour=%s", $station, $syear, $smonth, $sday, $shour, $eyear, $emonth, $eday, $ehour);
if (isset($_REQUEST["action"])) {
    $sts = mktime(0, 0, 0, $smonth, $sday, $syear);
    $ets = mktime(0, 0, 0, $emonth, $eday, $eyear);
    if ($_REQUEST["action"] == 'dl') {
        download_data($sts, $ets);
        die;
    }
}
include "../../include/myview.php";
$t = new MyView();
$t->title = "Atmospheric Structure Instrumentation";
$t->thispage = "networks-other";
$channels = array("ch1" => "Wind Speed @48.5m [m/s]", "ch2" => "Wind Speed @48.5m [m/s]", "ch3" => "Wind Speed @32m [m/s]", "ch4" => "Wind Speed @32m [m/s]", "ch5" => "Wind Speed @10m [m/s]", "ch6" => "Wind Speed @10m [m/s]", "ch7" => "Wind Direction @47m [deg]", "ch8" => "Wind Direction @40m [deg]", "ch9" => "Wind Direction @10m [deg]", "ch10" => "Air Temperature @3m [C]", "ch11" => "Air Temperature @48.5m [C]", "ch12" => "Barometer @48.5m [mb]");
$c = "";
while (list($key, $ch) = each($channels)) {
    $c .= sprintf("<tr><td>%s</td><td>%s</td></tr>", $key, $ch);
}
$nselect = networkSelect("ISUASI", $station);
$ys = yearSelect2(2012, $syear, "syear");
$ms = monthSelect($smonth, "smonth");
コード例 #2
0
set_time_limit(0);
//Gets the datetime for use in filename and source object
$dateArray = getdate();
//File name. Do NOT adjust. File name is specified
$fnameND = "vipFeed-{$countyFIPS}.xml";
$fnameZipND = $fnameND . ".zip";
$fname = $localDirectory . $fnameND;
$fnameZip = $localDirectory . $fnameZipND;
//File handles
$logHandle = fopen($logFname, "w+");
$xmlHandle = fopen($fname, "w");
//download data
//download_data("http://talkingpointsmemo.com/images/","bernanke-askance-large.jpg","");
download_data($webDirectory, $precinctsFile, $localDirectory);
download_data($webDirectory, $locationsFile, $localDirectory);
download_data($webDirectory, $segmentsFile, $localDirectory);
//Add contents to feed.
$contents = addHeader($dateArray);
fwrite($xmlHandle, $contents);
$contents = addPrecincts(file_get_contents($localDirectory . $precinctsFile));
fwrite($xmlHandle, $contents);
$contents = addLocations(file_get_contents($localDirectory . $locationsFile));
fwrite($xmlHandle, $contents);
$contents = addSegments(file_get_contents($localDirectory . $segmentsFile), $xmlHandle);
fwrite($xmlHandle, $contents);
$contents = addFooter();
fwrite($xmlHandle, $contents);
zip_file($fname, $fnameZip);
if ($autoFTPupload) {
    post_file($ftp_directory . $fnameZipND, $fnameZip, $ftp_server, $ftp_user, $ftp_pass);
}