开发者

RSS parsing last build Date. Fastest way to do so please

开发者 https://www.devze.com 2023-01-02 09:21 出处:网络
Dim myRequest As System.Net.WebRequest = System.Net.WebRequest.Create(url) Dim myResponse As System.Net.WebResponse = myRequest.GetResponse()
    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 - 开发者_如何学JAVA1
    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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号