google weather api
来源:互联网 发布:全美测评软件是什么 编辑:程序博客网 时间:2024/05/29 10:19
include("conn.php");$strsql="select * from latlon where name=’".$_GET['city']."’"; $result=mysql_db_query($mysql_database, $strsql, $conn); // u83b7u53d6u67e5u8be2u7ed3u679c,1 = name 2= latlon 3=weidu 4 = jingdu $row=mysql_fetch_row($result); mysql_data_seek($result, 0); $row=mysql_fetch_row($result); if(empty($row[1])){ $re =array( "noCity"=>"no data", "yes"=>0, ); echo ""; }else{ $nlatlon= $row[4].’,’.$row[3]; $back=$row[3]*1000000.$row[4]*1000000;$url=’http://www.google.com/ig/api?weather=,,,’.$back;$xml = simplexml_load_file($url);$re=array( "yes"=>1,"today" =>(string)($xml->weather->forecast_conditions[0]->condition['data']),"ssd"=>(string)($xml->weather->current_conditions->temp_c['data']),"sd"=>(string)($xml->weather->current_conditions->humidity['data']),"fx"=>(string)($xml->weather->current_conditions->wind_condition['data']),"icon"=>’http://www.google.com’.($xml->weather->forecast_conditions[0]->icon['data']),"week1" =>(string)($xml->weather->forecast_conditions[1]->day_of_week['data']),"week1zuidi" =>(int)((int)((string)($xml->weather->forecast_conditions[1]->low['data'])-32)/1.8+1),"week1zuigao" =>(int) ((int)((string)($xml->weather->forecast_conditions[1]->high['data'])-32)/1.8+1),"week1tianqi" =>(string)($xml->weather->forecast_conditions[1]->condition['data']),"week1icon" =>’http://www.google.com’.($xml->weather->forecast_conditions[1]->icon['data']),"week2" =>(string)($xml->weather->forecast_conditions[2]->day_of_week['data']),"week2zuidi" =>(int) ((int)((string)($xml->weather->forecast_conditions[2]->low['data'])-32)/1.8+1),"week2zuigao" =>(int) ((int)((string)($xml->weather->forecast_conditions[2]->high['data'])-32)/1.8+1),"week2tianqi" =>(string)($xml->weather->forecast_conditions[2]->condition['data']),"week2icon" =>’http://www.google.com’.($xml->weather->forecast_conditions[2]->icon['data']),"week3" =>(string)($xml->weather->forecast_conditions[3]->day_of_week['data']),"week3zuidi" =>(int) ((int)((string)($xml->weather->forecast_conditions[3]->low['data'])-32)/1.8+1),"week3zuigao" =>(int) ((int)((string)($xml->weather->forecast_conditions[3]->high['data'])-32)/1.8+1),"week3tianqi" =>(string)($xml->weather->forecast_conditions[3]->condition['data']),"week3icon" =>’http://www.google.com’.($xml->weather->forecast_conditions[3]->icon['data']),"nlatlon" =>$nlatlon,"googleurl"=>$url,);}echo json_encode($re); mysql_free_result($result);mysql_close($conn);
- google weather api
- google weather api icon
- 使用Google Weather的API
- Google Weather API 参考文档
- Google Weather API非官方文档
- Google Weather API 参考文档
- google weather api 谷歌天气api
- 使用Google Weather API查询天气预报
- 使用Google Weather API查询天气预报
- 使用Google Weather API查询天气预报
- 使用Google Weather API查询天气预报
- 使用Google Weather API查询天气预报
- 使用Google Weather API查询天气预报
- 使用Google Weather API查询天气预报
- 使用Google Weather API查询天气预报
- 使用Google Weather API查询天气预报
- 使用Google Weather API查询天气预报
- Google weather API 天气使用方式
- 领域对象设计
- 李开复实现了程序员的最高境界
- 手把手教你Linux系统下快速设置NFS
- rand()和srand()产生伪随机数的方法总结(转)
- 查看机器是32位还是64位
- google weather api
- Document. Cookies
- web.config中globalization设置的问题
- 15 Cookie对象
- JVM 内存
- beginning python summary chapter 6 - 抽象
- AJAX 应用
- February 24th Wednesday 2010
- 日语词典 Dr.mouse 绿色版