RSS app sometimes works

TGImages

New member
Joined
Jul 1, 2009
Messages
2
Programming Experience
10+
I've been writing a fairly simple RSS Reader... more for practice than any other reason however I found a really interesting problem that I haven't been able to get around.

Most of the feeds work fine and my app is able to pull a list of items. However a couple of feeds do not pull any items. When looking at the raw XML of the feeds they look essentially identical... but in these cases no data (items) are pulled.

To make it a bit more difficult, 2 of the feeds are from the same "blog" site. One works, one doesn't.


Feed yields items
GM-VOLT : Chevy Volt Electric Car Site


Feed does not yield any items
24 boxes


Test app to illustrate this:


Imports System.Xml
Imports System.Net
Imports System.IO

Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Dim myRequest As WebRequest = System.Net.WebRequest.Create("http://feeds.feedburner.com/Gm-volt?format=xml")
'Dim myRequest As WebRequest = System.Net.WebRequest.Create("http://feeds.feedburner.com/24Boxes?format=xml")
Dim myResponse As WebResponse = myRequest.GetResponse()
Dim rssStream As Stream = myResponse.GetResponseStream()
Dim rssDoc As New XmlDocument()
rssDoc.Load(rssStream)
Dim rssItems As XmlNodeList = rssDoc.SelectNodes("rss/channel/item")

MsgBox("item count = " & rssItems.Count)

End
End Sub
End Class


For the first feed (comment/uncomment two test lines) I get a number (usually 10), for the second feed it always returns zero.

Anyone seen this before? Any ideas why I'm getting data from one feed and not the other? The feeds are generated by the same site so I would expect my code to work either way.
 
Thanks... while still trying to find a solution, after posting, I stumbled upon that realization my self and have been researching the differences.

I'll try your recommendation and see what I can get.
 
That is great, the Syndication namespace was new to me. It seems to work well with both these feeds.

It doesn't support older rss (rdf) though, some feeds still use this format. The RSS.Net library does, but without Atom support. There's also this article Syndicating and Consuming RSS 1.0 (RDF) Feeds in ASP.NET 3.5 that has a library for Rss10FeedFormatter, but it won't work with the simple SyndicationFeed.Load call for reading any feed.
 
Back
Top