Using the BO API to create weather viewing software

Source: Internet
Author: User

Let's take a look at the effect.

Interface Address: http://service.boapi.net/Weather/Weather.ashx?appkey= The name of the appkey&city= city you applied for

Interface Description Details View http://www.boapi.net/weather.htm

Request Service Critical Code

Jtoken Wheatherjson(StringCity){ WebClientWc= New WebClient(); StringJson= ""; Try {Wc.Encoding = System.Text.Encoding.utf8; json = Wcdownloadstring ( + City  return  (jtokenjsonconvert. Deserializeobjectjson} catch{} } 

The returned result

{C:"101010100","CN":China,"PN":Beijing,"DN":Beijing,"Unch":Beijing,"Unen":"Beijing","Date":"2015/4/22 11:00:00","FW":[{"DPH":Sunny,"DP":"D00.gif","NPH":Cloudy,"NP":"N01.gif","DT":"27","NT":"14","DWD":South Wind,"NWD":South Wind,"DWP":"Level 3-4","NWP":"Level 3-4","SS":"05:27|18:59"},{"DPH":Cloudy,"DP":"D01.gif","NPH":Sunny,"NP":"N00.gif","DT":"29","NT":"11","DWD":North Wind,"NWD":"No continuous Wind direction","DWP":"Level 3-4","NWP":Breeze,"SS":"05:25|19:00"},{"DPH":Sunny,"DP":"D00.gif","NPH": "clear" , "NP" :  "n00.gif" , "DT" : "27" Span class= "pun" >, "NT" : " "DWD" : "No continuous wind Direction" , "NWD" Span class= "pun" >: "No continuous wind Direction" , "DWP" : "Breeze" ,: "Breeze" , "ss" : "05:24|19:01" } ]}  

Return parameter description

C City Code Fi Weather Index
cn Name Cin Chinese index name
Pn Name of province municipality Ic Index level
Dn City Name Ad Index related recommendations
Unch Name of city in Chinese
Unen City English Name
Date Weather Update Time
Fw Future Weather
DPH Daytime weather phenomena
Dp Daytime weather Icons
Nph Night Weather phenomena
Np Night Weather Icons
Dt Daytime temperature
Nt Night temperature
Dwd Daytime Wind
Nwd The Wind at night
Dwp Daytime Wind
Nwp Night Wind
Ss Sunrise and Sunset Time

If you want to get more weather icons to http://www.boapi.net/TechBlog.aspx?id=1001&blog=boapi download

Using the BO API to create weather viewing software

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.