Home Backend Development PHP Tutorial PHP做天气预报采集程序解决方案

PHP做天气预报采集程序解决方案

Jun 13, 2016 am 10:11 AM
api com google http weather

PHP做天气预报采集程序
求解答:PHP做天气预报采集程序,根据访问者的ip,判断得出当前城市天气预报。

------解决方案--------------------
先获取用户ip 通过ip得到用户所在地,然后通过所在地获取天气信息,下面是两个接口:

http://counter.sina.com.cn/ip/

http://www.google.com/ig/api?hl=zh-cn&weather=shanghai
------解决方案--------------------
Google的天气api weather参数可以填中文

http://www.google.com/ig/api?hl=zh-cn&weather=上海

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot Article

Hot Article

Hot Article Tags

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Google Pixel 9 and Pixel 9 Pro rumoured to gain Creative Assistant AI upon release Google Pixel 9 and Pixel 9 Pro rumoured to gain Creative Assistant AI upon release Jun 22, 2024 am 10:50 AM

Google Pixel 9 and Pixel 9 Pro rumoured to gain Creative Assistant AI upon release

Google Tensor G4 of Pixel 9 Pro XL lags behind Tensor G2 in Genshin Impact Google Tensor G4 of Pixel 9 Pro XL lags behind Tensor G2 in Genshin Impact Aug 24, 2024 am 06:43 AM

Google Tensor G4 of Pixel 9 Pro XL lags behind Tensor G2 in Genshin Impact

Google app beta APK teardown reveals new extensions coming to Gemini AI assistant Google app beta APK teardown reveals new extensions coming to Gemini AI assistant Jul 30, 2024 pm 01:06 PM

Google app beta APK teardown reveals new extensions coming to Gemini AI assistant

Google Pixel 9 smartphones will not launch with Android 15 despite seven-year update commitment Google Pixel 9 smartphones will not launch with Android 15 despite seven-year update commitment Aug 01, 2024 pm 02:56 PM

Google Pixel 9 smartphones will not launch with Android 15 despite seven-year update commitment

Google AI announces Gemini 1.5 Pro and Gemma 2 for developers Google AI announces Gemini 1.5 Pro and Gemma 2 for developers Jul 01, 2024 am 07:22 AM

Google AI announces Gemini 1.5 Pro and Gemma 2 for developers

New Google Pixel desktop mode showcased in fresh video as possible Motorola Ready For and Samsung DeX alternative New Google Pixel desktop mode showcased in fresh video as possible Motorola Ready For and Samsung DeX alternative Aug 08, 2024 pm 03:05 PM

New Google Pixel desktop mode showcased in fresh video as possible Motorola Ready For and Samsung DeX alternative

Google Pixel 9 Pro XL gets tested with desktop mode Google Pixel 9 Pro XL gets tested with desktop mode Aug 29, 2024 pm 01:09 PM

Google Pixel 9 Pro XL gets tested with desktop mode

Google opens AI Test Kitchen & Imagen 3 to most users Google opens AI Test Kitchen & Imagen 3 to most users Sep 12, 2024 pm 12:17 PM

Google opens AI Test Kitchen & Imagen 3 to most users

See all articles