Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

RSS reader...

Status
Not open for further replies.

finishingmove

Programmer
Apr 3, 2007
3
so basically i wanna do a "\n" after every <item>(title+link+date)

and display them in a listbox:

----------------------------
title link date
----------------------------
title link date
----------------------------
etc.

but i dont know how to parse it like that.

im kinda new to this , so any help is greatly appreciated :)
 
Here's a bit of what I did to make it work:

Code:
WebClient c = new WebClient();
string rssXml = ASCIIEncoding.Default.GetString(c.DownloadData("[URL unfurl="true"]http://news.google.com/?output=rss"));[/URL]
XmlDocument doc = new XmlDocument();
doc.LoadXml(rssXml);
XmlElement documentElement = doc.DocumentElement;

XmlNodeList items = doc.SelectNodes("rss/channel/item");
for (int i = 0; i < items.Count; i++)
{
	string listboxItem = "";
	XmlNode item = items[i];

	XmlNode title = item.SelectSingleNode("title");
	listboxItem += title.InnerText;

	XmlNode link = item.SelectSingleNode("link");
	listboxItem += "\t" + link.InnerText;

	XmlNode pubDate = item.SelectSingleNode("pubDate");
	listboxItem += "\t" + pubDate.InnerText;
	
	lstRss.Items.Add(listboxItem);
}

Ron Wheeler
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top