Code Monkey home page Code Monkey logo

weather_api's Introduction

weather_api

一、**气象台API接口:

  1. XML接口 http://flash.weather.com.cn/wmaps/xml/china.xml 这个是全国天气的根节点,列出所有的省,其中的pyName字段是各个省XML的文件名,比如北京的是beijing,那就意味着北京的XML地址为 http://flash.weather.com.cn/wmaps/xml/beijing.xml 一个省的天气,其中列出该省各个市的数据,北京就列出各个区。 tmp1是最低温低,tmp2是最高温度,state1和state2是神马转神马,每个数代表一个天气现象。

  2. 图片接口 http://m.weather.com.cn/img/c0.gif http://m.weather.com.cn/img/b0.gif http://www.weather.com.cn/m/i/weatherpic/29x20/d0.gif http://www.weather.com.cn/m2/i/icon_weather/29x20/n00.gif 这个图就是天气现象0(晴)的图片,其他天气现象的图片依此类推。c打头的图片是2020像素的,b打头的是5046像素的,d打头的是反白的图标,2920像素,n打头的是夜间反白图标,2920像素,注意这里的文件名是两位数字!

  3. JSON接口 http://m.weather.com.cn/data/101010100.html

http://www.weather.com.cn/data/sk/101010100.html

http://www.weather.com.cn/data/cityinfo/101010100.html

各个城市的代码,自己百度一下。例如:北京的代码就是101010100

二、中华万年历API接口:

1、JSON

http://wthrcdn.etouch.cn/weather_mini?city=北京

http://wthrcdn.etouch.cn/weather_mini?citykey=101010100

2、XML

http://wthrcdn.etouch.cn/WeatherApi?city=北京

http://wthrcdn.etouch.cn/WeatherApi?citykey=101010100

三、新浪天气API接口:

http://php.weather.sina.com.cn/xml.php?city=%B9%E3%D6%DD&password=DJOYnieT8234jlsK&day=1

city=城市的URL编码(广州:%B9%E3%D6%DD)。

password固定。

day=0,表示当天天气,1表示第二天天气,以此类推,最大取值为4。

新浪天气图片:

78*78:

白天:http://php.weather.sina.com.cn/images/yb3/78_78/duoyun_0.png

夜间:http://php.weather.sina.com.cn/images/yb3/78_78/duoyun_1.png

180*180:

白天:http://php.weather.sina.com.cn/images/yb3/180_180/duoyun_0.png

夜间:http://php.weather.sina.com.cn/images/yb3/180_180/duoyun_1.png

weather_api's People

Contributors

chuangyeshuo avatar

Stargazers

KSun avatar  avatar

Watchers

James Cloos avatar  avatar

Forkers

williamlaw99

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.