How To Discover RSS Feeds for a given URL

后端 未结 6 1803
猫巷女王i
猫巷女王i 2020-12-01 00:45

I get a URL from a user. I need to know:
a) is the URL a valid RSS feed?
b) if not is there a valid feed associated with that URL

using PHP/Javascript or s

6条回答
  •  旧时难觅i
    2020-12-01 01:35

    For Perl, there is Feed::Find , which does automate the discovery of syndication feeds from the webpage. The usage is quite simplicistic:

    use Feed::Find;
    my @feeds = Feed::Find->find('http://example.com/');
    

    It first tries the link tags and then scans the a tags for files named .rss and something like that.

提交回复
热议问题