Ver Mensaje Individual
  #1 (permalink)  
Antiguo 24/11/2011, 13:16
albertopc1
 
Fecha de Ingreso: septiembre-2010
Mensajes: 9
Antigüedad: 13 años, 7 meses
Puntos: 0
Mensaje Problema con api google

Hola, soy estudiante de un ciclo superior de informatica y todavia no hemos hecho php y no tengo mucha idea, la cosa es que en mi web quiero tener una aplicacion de google del tiempo, para ver si asi me la validan la cuenta adsense. El problema es que está en ingles el código en php, y me gustaría que estuviera en castellano obviamente. Como lo puedo hacer? Quiero cambiar de farenheit a grados, los dias de la semana que salgan en castellano, y tambien si hace sol o no.. Os lo agradecería muchísimo porfavor, os dejo el código de esta web: http://www.alevsk.com/2011/03/google-weather-api-y-php/ (para que veais como es el diseño)

el código:
<?
02 if (empty($_POST['ciudad']))
03 {
04 ?>
05 <form action="weather.php" method="post"><input type="hidden" name="phpMyAdmin" value="3068b5491f703bc27d2a43326f772556" />
06 <input name="ciudad" type="text" id="ciudad" />
07 <input type="submit" value="Enviar" />
08 </form>
09 <?php
10 }
11 else
12 {
13 $xml = simplexml_load_file('http://www.google.com/ig/api?weather='.$_POST['ciudad']);
14 $information = $xml->xpath("/xml_api_reply/weather/forecast_information");
15 $current = $xml->xpath("/xml_api_reply/weather/current_conditions");
16 $forecast_list = $xml->xpath("/xml_api_reply/weather/forecast_conditions");
17 ?>
18 <html>
19 <head>
20 <title>Google Weather API</title>
21 <style type="text/css" media="screen">
22 body {
23 font-family:"Lucida Grande","Lucida Sans Unicode",Arial,Verdana,sans-serif;
24 font-size:12px;
25 color:#4D4D4D;
26 }
27 a
28 {
29 color:#4D4D4D;
30 }
31
32 h2 {
33 font-size:14px;
34 }
35 .weather {
36 background:#EEF2F6;
37 padding:4px;
38 margin-bottom:2px;
39 width:400px;
40 overflow:hidden;
41 }
42 .weather img {
43 vertical-align:middle;
44 float:left;
45 margin-right:4px;
46 }
47 </style>
48 </head>
49 <body>
50 <h1><?= print $information[0]->city['data']; ?></h1>
51 <h2>El clima de hoy</h2>
52 <div class="weather">
53 <img src="<?= 'http://www.google.com' . $current[0]->icon['data']?>" alt="weather"?>
54 <span class="condition">
55 <?= $current[0]->temp_f['data'] ?>&deg; F,
56 <?= $current[0]->condition['data'] ?>
57 </span>
58 </div>
59 <h2>Forecast</h2>
60 <? foreach ($forecast_list as $forecast) : ?>
61 <div class="weather">
62 <img src="<?= 'http://www.google.com' . $forecast->icon['data']?>" alt="weather"?>
63 <div><?= $forecast->day_of_week['data']; ?></div>
64 <span class="condition">
65 <?= $forecast->low['data'] ?>&deg; F - <?= $forecast->high['data'] ?>&deg; F,
66 <?= $forecast->condition['data'] ?>
67 </span>
68 </div>
69 <? endforeach ?>
70 ... <h2><a href="weather.php?phpMyAdmin=3068b5491f703bc27d2a4 3326f772556">Regresar <<</a></h2>
71 </body>
72 </html>
73 <?php } ?>