views:

19

answers:

1
    Dim myRequest As System.Net.WebRequest = System.Net.WebRequest.Create(url)
    Dim myResponse As System.Net.WebResponse = myRequest.GetResponse()
    Dim rssStream As System.IO.Stream = myResponse.GetResponseStream()
    Dim rssDoc As New System.Xml.XmlDocument()
    Try
        rssDoc.Load(rssStream)
    Catch nosupport As NotSupportedException
        Throw nosupport
    End Try
    Dim rssItems As System.Xml.XmlNodeList = rssDoc.SelectNodes("rss/channel")
    'For i As Integer = 0 To rssItems.Count - 1
    Dim rssDetail As System.Xml.XmlNode
    rssDetail = rssItems.Item(0).SelectSingleNode("lastBuildDate")

Folks this is what I'm using to parse an RSS feed for the last updated time. Is there a quicker way? Speed seems to be a bit slow on it as it pulls down the entire feed before parsing.

A: 

Use the XMLReader class to read the data as it comes in. As soon as you find what you are looking for you can kill the stream.

DaMartyr