当前在线人数17208
首页 - 分类讨论区 - 电脑网络 - 窗口里的风景版 -阅读文章
未名交友
[更多]
[更多]
文章阅读:using weather XML feed in C# - 1
[同主题阅读] [版面: 窗口里的风景] [作者:LodossWar] , 2003年10月19日21:16:43
LodossWar
进入未名形象秀
我的博客
[上篇] [下篇] [同主题上篇] [同主题下篇]

发信人: LodossWar (sleepycat), 信区: DotNet
标  题: using weather XML feed  in C# - 1
发信站: Unknown Space - 未名空间 (Sun Oct 19 21:18:23 2003) WWW-POST

很多站点提供了XML feed,这样你就不需要通过分析他们的网页来得到你自己要的信息了

你可以直接得到XML格式的信息。

比如你想得到天气信息:
假设你的zipcode是97401,用这个试试:
http://www.weatherroom.com/xml/ext/97401

所以,给定zipcode xxxxx,你总可以通过
http://www.weatherroom.com/xml/ext/xxxxx得到你要的信息

以下是97401的天气预报
<?xml version="1.0" encoding="utf-8" ?>
- <WeatherFeed xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.weatherroom.com">
- <Current>
  <internal />
  <Location>Eugene, OR, United States</Location>
  <RecordedAt>Mahlon Sweet Field, OR, United States</RecordedAt>
  <Updated>954 AM PDT SUN OCT 19 2003</Updated>
  <Conditions>Mostly Cloudy</Conditions>
  <Image>http://www.weatherroom.com/images/fcicons/mcloudy.gif</Image>
  <Visibility>10 Mi</Visibility>
  <Temp>59°F</Temp>
  <Humidity>88%</Humidity>
  <Wind>SE 12 MPH</Wind>
  <Barometer>30.08 in.</Barometer>
  <Dewpoint>55°F</Dewpoint>
  <HeatIndex>59°F</HeatIndex>
  <WindChill>57°F</WindChill>
  <Sunrise>7:31 AM PDT</Sunrise>
  <Sunset>6:23 PM PDT</Sunset>
  <MoonPhase>Waning Crescent Moon</MoonPhase>
  </Current>
- <Forecast>
  <Config />
  <Date>SUN OCT 19 2003</Date>
  <Time>940 AM PDT SUN</Time>
- <Today>
  <Conditions>Chance Of Showers</Conditions>
  <High>65°F</High>
  <Low>53°F</Low>
  </Today>
- <Monday>
  <Conditions>Chance Of Rain</Conditions>
  <High>73°F</High>
  <Low>53°F</Low>
  </Monday>
- <Tuesday>
  <Conditions>Partly Cloudy</Conditions>
  <High>70°F</High>
  <Low>48°F</Low>
  </Tuesday>
- <Wednesday>
  <Conditions>Chance Of Rain</Conditions>
  <High>63°F</High>
  <Low>45°F</Low>
  </Wednesday>
- <Thursday>
  <Conditions>Chance Of Showers</Conditions>
  <High>63°F</High>
  <Low>45°F</Low>
  </Thursday>
  </Forecast>
  <PoweredBy>www.weatherroom.com</PoweredBy>
  <Copyright>Canadian forecasts are obtained from and are copyright of
Environment Canada. All other data is derived from the NWS and other public
domain sources. This feed is copyright 2003 weatherroom.com. It may be used
freely provided that you include a link to our web site.</Copyright>
  </WeatherFeed>


--
※ 修改:·LodossWar 於 Oct 19 21:18:23 修改本文·[FROM: 141.151.]
※ 来源:.Unknown Space - 未名空间 mitbbs.com.[FROM: 141.151.]

[上篇] [下篇] [同主题上篇] [同主题下篇]
[转寄] [转贴] [回信给作者] [修改文章] [删除文章] [同主题阅读] [从此处展开] [返回版面] [快速返回] [收藏] [举报]
 
回复文章
标题:
内 容:

未名交友
将您的链接放在这儿

友情链接


 

Site Map - Contact Us - Terms and Conditions - Privacy Policy

版权所有,未名空间(mitbbs.com),since 1996