• Well I wasn’t sure what to title this post. Here’s what I want to do:

    I have a wordpress blog hosted on one server. I have an ASP.NET site hosted on a different server.

    I’d like every page in my ASP.NET site to display an RSS feed of “related blog posts” — blog posts with certain tags.

    I’d like my wordpress site’s RSS feed to output tags, so that each entry in the rss feed can have certain tags associated with it, so that my ASP.NET site’s RSS reader will be able to find the entries that have certain tags. Is this doable? I’ve noticed that tags aren’t included in the RSS feed by default. Is there a way to get tags into the RSS feed so my ASP.net site will know which entries are associated with certain tags?

    I have a simple RSS reader written in C#:

    public void ProcessRSSItem(string rssURL)
        {
            System.Net.WebRequest myRequest = System.Net.WebRequest.Create(rssURL);
            System.Net.WebResponse myResponse = myRequest.GetResponse();
    
            System.IO.Stream rssStream = myResponse.GetResponseStream();
            System.Xml.XmlDocument rssDoc = new System.Xml.XmlDocument();
            rssDoc.Load(rssStream);
    
            System.Xml.XmlNodeList rssItems = rssDoc.SelectNodes("rss/channel/item");
    
            string title = "";
            string link = "";
            string description = "";
    
            for (int i = 0; i < rssItems.Count; i++)
            {
                System.Xml.XmlNode rssDetail;
    
                rssDetail = rssItems.Item(i).SelectSingleNode("title");
                if (rssDetail != null)
                {
                    title = rssDetail.InnerText;
                }
                else
                {
                    title = "";
                }
    
                rssDetail = rssItems.Item(i).SelectSingleNode("link");
                if (rssDetail != null)
                {
                    link = rssDetail.InnerText;
                }
                else
                {
                    link = "";
                }
    
                rssDetail = rssItems.Item(i).SelectSingleNode("description");
                if (rssDetail != null)
                {
                    description = rssDetail.InnerText;
                }
                else
                {
                    description = "";
                }
    
                Response.Write("<p><b><a href='" + link + "' target='new'>" + title + "</a></b><br/>");
                Response.Write(description + "</p>");
            }
        }

    And the other piece of this puzzle is getting that RSS reader to search the RSS feed for certain tags. Any ideas on how to accomplish that?

    I’m really new to C# and ASP.NET development, so any help would be greatly appreciated!

  • The topic ‘Filtering entries by tag on ASP.NET site’ is closed to new replies.