如何检测网址是否包含Feed?

Vee*_*era 1 browser rss feeds atom-feed

我在一些浏览器中看到过(例如Firefox),只有当页面包含RSS/Atom提要时才会激活RSS提要图标.浏览器如何检测页面是否包含Feed?

bra*_*ant 5

只需查看此页面的代码即可.你会在标题中的一些javascript之后看到这个:

<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"> 
Run Code Online (Sandbox Code Playgroud)

或者,许多博客使用

<link rel="alternate" type="application/rss+xml" title="Post Title" href="link-to-post"> 
Run Code Online (Sandbox Code Playgroud)