Solved

RSS feed reading

Posted on 2012-03-20
1
394 Views
Last Modified: 2012-06-27
My application reads a rss feed that contains posts by categories, and i have those categories pragmatically inserted in the code. What i want to know is how to read a rss feed and generate the categories for the tableview dynamically.

Best Regards.
0
Comment
Question by:BrunoSurprise
1 Comment
 
LVL 7

Accepted Solution

by:
Lalit Chandra earned 500 total points
ID: 37744820
create a class

public class RSSItem
{
    public string title {get;set;}
    public string link  {get;set;}
    public string description  {get;set;}
 }

 then use linq to get a collection of RSSItem

public List<RSSItem> items;
 XElement rssFeed = XElement.Load(url).Element("channel");
 items = (from Item in rssFeed.Elements("item")
                 select new RSSItem()
                 {
                     title = Item.Element("title").Value,
                     description = Item.Element("description").Value,
                     link = Item.Element("link").Value
                 }).ToList<RSSItem>();


Now,you can iterate over the collection  rssFeed using ForEach ,and get your desire format.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Ever wanted to watch videos in your computer from the bed without the need of standing up and shutting down the computer?  Is your computers operating system Windows XP, Windows Vista or Windows 7?  Do you own a iOS device? If all the answers were y…
I recently went through the process of creating an installable image of an iPhone mobile app (an .ipa file) that beta testers could load onto their test devices. The process involved quite a few steps, but both Appcelerator and Diawi.org had decent …
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now