|
-
Dec 5th, 2005, 03:07 PM
#1
Thread Starter
New Member
How to Read Single RSS Node?
I am trying to obtain specific information about the weather by downloading the Yahoo RSS Weather feed. I have successfully been able to load the RSS into an XML Document using the following code:
Dim m_xmld As XmlDocument
Dim m_node As XmlNode
'Create the XML Document
m_xmld = New XmlDocument()
'Load the Xml file
m_xmld.Load("http://xml.weather.yahoo.com/forecastrss?p=USMA0401&u=f")
I know that I now have to populate an XMLnodelist to access the data, but I am stumped. Can anyone show me how to extract, say the temerpature from this XML file? The RSS feed is below.
RSS DATA:
<rss version="2.0">
<channel>
<title>Yahoo! Weather - Southbridge, MA</title>
-
<link>
http://us.rd.yahoo.com/dailynews/rss...SMA0401_f.html
</link>
<description>Yahoo! Weather for Southbridge, MA</description>
<language>en-us</language>
<lastBuildDate>Mon, 05 Dec 2005 1:54 pm EST</lastBuildDate>
<ttl>60</ttl>
<yweather:location city="Southbridge" region="MA" country="US"/>
<yweather:units temperature="F" distance="mi" pressure="in" speed="mph"/>
<yweather:wind chill="21" direction="240" speed="8"/>
<yweather:atmosphere humidity="57" visibility="1609" pressure="30.04" rising="2"/>
<yweather:astronomy sunrise="7:01 am" sunset="4:16 pm"/>
-
<image>
<title>Yahoo! Weather</title>
<width>142</width>
<height>18</height>
<link>http://weather.yahoo.com/</link>
-
<url>
http://us.i1.yimg.com/us.yimg.com/i/.../main_142b.gif
</url>
</image>
-
<item>
<title>Conditions for Southbridge, MA at 1:54 pm EST</title>
<geo:lat>42.08</geo:lat>
<geo:long>-72.03</geo:long>
-
<link>
http://us.rd.yahoo.com/dailynews/rss...SMA0401_f.html
</link>
<pubDate>Mon, 05 Dec 2005 1:54 pm EST</pubDate>
<yweather:condition text="Partly Cloudy" code="34" temp="29" date="Mon, 05 Dec 2005 1:54 pm EST"/>
-
<description>
<img src="http://us.i1.yimg.com/us.yimg.com/i/us/we/52/34.gif" /><br />
<b>Current Conditions:</b><br />
Partly Cloudy, 29 F<p />
<b>Forecast:</b><BR />
Mon - Partly Cloudy. High: 31 Low: 22<br />
Tue - Snow. High: 30 Low: 14<br />
Wed - Mostly Sunny. High: 29 Low: 11<br />
<br />
<a href="http://us.rd.yahoo.com/dailynews/rss/weather/Southbridge__MA/*http://xml.weather.yahoo.com/forecast/USMA0401_f.html">Full Forecast at Yahoo! Weather</a><BR/>
(provided by The Weather Channel)<br/>
</description>
<yweather:forecast day="Mon" date="05 Dec 2005" low="22" high="31" text="Partly Cloudy" code="30"/>
<yweather:forecast day="Tue" date="06 Dec 2005" low="14" high="30" text="Snow" code="16"/>
<yweather:forecast day="Wed" date="07 Dec 2005" low="11" high="29" text="Mostly Sunny" code="34"/>
<guid isPermaLink="false">USMA0401_2005_12_05_13_54_EST</guid>
</item>
</channel>
</rss>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|