Search code examples
c#urlblogsfeed

how to get RSS or ATOM feed url from blogurl


how i can get feed url (RSS Or ATOM) from blog url ex:- http://anirudhagupta.blogspot.com/ So how i can get his feed dynamically by c#

i say that how i can get blog's feedurl by using Regex and c#


Solution

  • The Rss feeds can vary with what you specifically want to look at, but for blogspot it's usually

    blogname/feeds/posts/default ie. http://anirudhagupta.blogspot.com/feeds/posts/default

    If you're using VS 2008, you can use the SyndicationFeed object to read both RSS and ATOM feeds. (I assume this is what you want to do when you say "get his feed dynamically")

    XmlReader reader = XmlReader.Create(feedUriString);
    SyndicationFeed feed = SyndicationFeed.Load(reader);
    foreach (SyndicationItem item in feed.Items)
    {
    //your code for rendering each item
    }
    

    http://msdn.microsoft.com/en-us/library/system.servicemodel.syndication.aspx http://jimleonardo.blogspot.com/2009/02/jimleocom-is-back-up-some-how-to.html