Search code examples
browserrssfeedatom-feed

How to detect if a web URL contains a feed or not?


I have seen in some browsers (Firefox for example), the RSS feed icon gets activated only when a page contains a RSS/Atom feed. How the browser detects whether the page contains a feed or not?


Solution

  • Just look at the code for this page. You'll see this after some javascript in the header:

    <link rel="alternate" type="application/atom+xml" title="Feed for question 'How to detect if a web URL contains a feed or not?'" href="/feeds/question/3020295"> 
    

    Alternatively, many blogs use

    <link rel="alternate" type="application/rss+xml" title="Post Title" href="link-to-post">