Click here to Skip to main content
15,740,915 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
I want to show live cricket score card on my web application. for achieving this i tried to read the RSS Feed from several site but its only showing me the match detail like time and the country between the game will be played.

Following is the code for aspx page
        <table cellpadding="0" cellspacing="0">
                    <table class="NormalText" runat="server" id="tbl_Feed_Reader" cellpadding="0" cellspacing="0">

in code behind :
public partial class _Default : System.Web.UI.Page
        protected void Page_Load(object sender, EventArgs e)
            RSSFeedService rssFeedSerice_obj = new RSSFeedService();
        public void ReadRssFeed()
            string rssFeedUrl = "";
            WebRequest requestFeedfrmUrl = WebRequest.Create(rssFeedUrl);
            WebResponse responseFeedfrmUrl = requestFeedfrmUrl.GetResponse();
            Stream streamRssFedd = responseFeedfrmUrl.GetResponseStream();
            XmlDocument scoreRssFeed = new XmlDocument();
            XmlNodeList scoreNode = scoreRssFeed.SelectNodes("rss/channel/item");
            string sTitle = "";
            string sLink = "";
            string sDescription = "";
            //iterate through node list
            for (int i = 0; i < scoreNode.Count; i++)
                XmlNode scoreRSSDetail;
                scoreRSSDetail = scoreNode.Item(i).SelectSingleNode("title");
                if (scoreRSSDetail != null)
                    sTitle = scoreRSSDetail.InnerText;
                    sTitle = "";
                scoreRSSDetail = scoreNode.Item(i).SelectSingleNode("link");
                if (scoreRSSDetail != null)
                    sLink = scoreRSSDetail.InnerText;
                    sLink = "";
                scoreRSSDetail = scoreNode.Item(i).SelectSingleNode("description");
                if (scoreRSSDetail != null)
                    sDescription = scoreRSSDetail.InnerText;
                    sDescription = "";
                //generate HTML table
                HtmlTableCell block = new HtmlTableCell();
                block.InnerHtml = "<span style='font-weight:bold'><a href='" + sLink + "' target='new'>" + sTitle + "</a></span>";
                HtmlTableRow row = new HtmlTableRow();
                HtmlTableCell block_description = new HtmlTableCell();
                block_description.InnerHtml = "<p align='justify'>" + sDescription + "</p>";
                HtmlTableRow row2 = new HtmlTableRow();

Can any one tell me whether this approach is right or help me with some suggestion.
Updated 27-Feb-11 21:35pm

html to solve?.........................
Share this answer
Reading an RSS feed is ok.
So basically on the whole this approach is ok.

Just wondering, why do you want to build an application like this when there are tons of them available anyway.
Share this answer
spydeehunk 28-Feb-11 3:49am    
I just want to create such kind of application, it for study purpose.if u hv any idea just let me now.Have you gone through this code because it not returnning live score. or M using not correct URL

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900