开发者

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

开发者 https://www.devze.com 2023-01-03 06:39 出处:网络
I have seen in some browsers (Firefox for example), the RSS feed icon 开发者_JAVA技巧gets activated only when a page contains a RSS/Atom feed. How the browser detects whether the page contains a feed

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


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"> 
0

精彩评论

暂无评论...
验证码 换一张
取 消