Quantcast
Channel: how to RSSFeeds from Multiple Websites - Stack Overflow
Viewing all articles
Browse latest Browse all 2

how to RSSFeeds from Multiple Websites

$
0
0

i am gettting RssFeeds for my site and it is showing.But how to get RSS Feeds from multiple sites and need to show in line from 1st site three feeds,2nd site three feeds etc;mostly from CNN,BBC

here is my code :

protected void Page_Load(object sender, EventArgs e){    BlogFeeds();}protected void BlogFeeds(){    try    {        XmlDocument xmldoc = new XmlDocument();        XmlNodeList items = default(XmlNodeList);        xmldoc.Load("http://rss.cnn.com/rss/edition_americas.rss");        xmldoc.Load("http://feeds.bbci.co.uk/news/rss.xml?edition=int#");        items = xmldoc.SelectNodes("/rss/channel/item");        // use XPath to get only items        string title = string.Empty;        string link = string.Empty;        string desc = string.Empty;        string pubDesc = string.Empty;        string st = "";        int i = 0;        foreach (XmlNode item1 in items)        {            foreach (XmlNode node1 in item1.ChildNodes)            {                if (node1.Name == "title")                {                    title = node1.InnerText;                }                if (node1.Name == "link")                {                    link = node1.InnerText;                }                if (node1.Name == "description")                {                    desc = node1.InnerText;                    if (desc.Length > 90)                    {                        pubDesc = desc.Substring(0, 90);                    }                    else                    { pubDesc = desc; }                }            }            st += "<a target='_blank' href='"+ link +"'>"+ title +"</a><br />"+ pubDesc +" ... "+"<div style='border-bottom: 1px dotted #84acfd; padding-top:10px;'></div></br>";            i++;            if (i == 3)                break;        }        lblBlogOutput.Text = st;    }    catch (Exception eax)    {        return;    }}

}


Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images