Answer the question
In order to leave comments, you need to log in
How to check RSS link?
I want to try to add a simple rss reader to the site. But I can’t understand whether it’s possible to somehow check the link that it is rss and leads exactly to the rss document before adding it. Is there any regular expression to check it?
Answer the question
In order to leave comments, you need to log in
if you ask the user for a link, then he himself is a fool, if he gives the wrong type of content,
with a high probability the link will contain the word rss (or type = rss, as many cms export their articles there or .rss) but by itself no one guarantees anything , there are no standards for this,
as it is correct - you request headers by link, without content, and look at the Content-Type should be text/rss+xml or application/rss+xml, rarely text/xml or application/xml but then only by content
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question