Answer the question
In order to leave comments, you need to log in
Api.wunderground - how to get the names of the days in Russian?
Hello!
With the help of the code I get the following weather informer:
I would like to Russify the days of the week
<?php
$ip = $_SERVER['REMOTE_ADDR'];
$url = 'http://api.sypexgeo.net/xml/'. $ip .'';
$xml = simplexml_load_string(file_get_contents($url));
$loc_array = array($xml->ip->city->lat,$xml->ip->city->lon);
$loc_safe = array();
foreach($loc_array as $loc){
$loc_safe[] = urlencode($loc);
}
$loc_string=implode(',', $loc_safe);
$json = file_get_contents('http://api.wunderground.com/api/****/satellite/webcams/forecast/q/' . $loc_string . '.json');
$obj = json_decode($json, true);
?>
<?
$html .= "</h2><table cellpadding=4 cellspacing=3><tr>";
foreach ($obj['forecast']['simpleforecast']['forecastday'] as $arr) {
$html .= "<td align='center'>" . $arr['date']['weekday'] . "<br />";
$html .= "<img src='http://icons-pe.wxug.com/i/c/k/" . $arr['icon'] . ".gif' border=0 /><br />";
$html .= "<font color='red'>" . $arr['high']['celsius'] . '°C' . " </font>";
$html .= "<font color='blue'>" . $arr['low']['celsius'] . '°C' . "</font>";
$html .= "</td>";
}
$html .= "</tr></table>";
echo $html;
?>
<script type="text/javascript">
window.onload=function(){
//пробовал так, не меняет, а вот в фидлере меняет
$("td:contains('Tuesday')").html("Вторник");
};
</script>
Answer the question
In order to leave comments, you need to log in
tell me how to pull up your pictures in this script. not standard?
and the output of the water temperature, if it is a sea city?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question