lisp2arx
Visual Programming for AutoLisp Mathématiques en programmation Lisp.. doc2cpp,doc2lsp, sld2lsp, bmp2dcl, free__GifCcapture for all-CAD'platforms..
Lista Forumurilor Pe Tematici
lisp2arx | Reguli | Inregistrare | Login

POZE LISP2ARX

Nu sunteti logat.
Nou pe simpatie:
Cristina02
Femeie
23 ani
Arges
cauta Barbat
26 - 80 ani
lisp2arx / ConverLISP / Php show weather from IP Moderat de zauchan
Autor
Mesaj Pagini: 1
admin
Administrator

Din: Bucharest
Inregistrat: acum 13 ani
Postari: 516
<?php

$geoplugin = unserialize( file_get_contents('http://www.geoplugin.net/php.gp?ip=' . $_SERVER['REMOTE_ADDR']) );

if ( is_numeric($geoplugin['geoplugin_latitude']) && is_numeric($geoplugin['geoplugin_longitude']) ) {

    $lat = $geoplugin['geoplugin_latitude'];
    $long = $geoplugin['geoplugin_longitude'];
    //set farenheight for US
    if ($geoplugin['geoplugin_countryCode'] == 'US') {
        $tempScale = 'fahrenheit';
        $tempUnit = '&deg;F';
    } else {
        $tempScale = 'celsius';
        $tempUnit = '&deg;C';
    }
    require_once('ParseXml.class.php');

    $xml = new ParseXml();
    $xml->LoadRemote("http://api.wunderground.com/auto/wui/geo/ForecastXML/index.xml?query={$lat},{$long}", 3);
    $dataArray = $xml->ToArray();

    $html = "<center><h2>Weather forecast for " . $geoplugin['geoplugin_city'];
    $html .= "</h2><table cellpadding=5 cellspacing=10><tr>";

    foreach ($dataArray['simpleforecast']['forecastday'] as $arr) {

        $html .= "<td align='center'>" . $arr['date']['weekday'] . "<br />";
        $html .= "<img src='http://icons-pe.wxug.com/i/c/a/" . $arr['icon'] . ".gif' border=0 /><br />";
        $html .= "<font color='red'>" . $arr['high'][$tempScale] . $tempUnit . " </font>";
        $html .= "<font color='blue'>" . $arr['low'][$tempScale] . $tempUnit . "</font>";
        $html .= "</td>";


    }
    $html .= "</tr></table>";

    echo $html;
}

?>


_______________________________________


pus acum 8 ani
   
Pagini: 1  

Mergi la