tags:

views:

72

answers:

1

I am trying to process an rss url, but is giving me an error as "'--' is an unexpected token. The expected token is '>'. Line 81, position 5."

when i look at the source it has a value "Knowledge@Wharton -- Innovation and Entrepreneurship" in the middle of the xml node.

How can i process this url and ignore that error.

Public Shared Function HasRssItems() As Boolean
    Dim myRequest As WebRequest
    Dim myResponse As WebResponse
    Try
        myRequest = System.Net.WebRequest.Create("http://www.google.com/reader/shared/i.am.muralibala")
        myRequest.Timeout = 5000
        myResponse = myRequest.GetResponse()

        Dim rssStream As Stream = myResponse.GetResponseStream()
        Dim rssDoc As New XmlDocument()
        rssDoc.Load(rssStream)

        Return rssDoc.SelectNodes("rss/channel/item").Count > 0
    Catch ex As Exception
        Return False
    Finally
        myResponse.Close()
    End Try

End Function
A: 

That page isn't a XML source; you should to use http://www.google.com/reader/public/atom/user/02179771748407903760/state/com.google/broadcast

Rubens Farias
Got it. Thank you.
vamsivanka