Solved

RSS feed reading

Posted on 2012-03-20
1
392 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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

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…
When Apple released Swift last year, the aim was to introduce a new programming language for Cocoa and Cocoa Touch that was fast, easy and effective, like the name connotes. Apple succeeded. Swift is designed to couple with Objective-C program…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
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.

744 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

10 Experts available now in Live!

Get 1:1 Help Now