Search RSS feed URLs from the given URL.
$ gem install feed_searcher
require "feed_searcher"
FeedSearcher.search("https://github.com/fastladder/feed_searcher")
#=> ["https://github.com/fastladder/feed_searcher/commits/master.atom"]
FeedSearcher.search("https://github.com/fastladder/feed_searcher/commits/master.atom")
#=> ["https://github.com/fastladder/feed_searcher/commits/master.atom"]
Let me explain how FeedSearcher works along its execution sequence.
- Fetches the HTML source of the given URL
- Finds link elements (represented as XPath format)
- Extracts URLs from the elements via its
href
attribute - Includes the given URL if its resource itself is a feed
- Converts from relative path to absolute path