FeedSearcher
Search RSS feed URLs from the given URL.
Installation
$ gem install feed_searcher
Usage
require "feed_searcher"
FeedSearcher.search("https://github.com/r7kamura/feed_searcher")
#=> ["https://github.com/r7kamura/feed_searcher/commits/master.atom"]
Internal
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 - Converts to absolute path if it is relative path
FeedSearcher finds link elements matcing following XPath patterns.
- //link[@rel='alternate'][@type='application/atom+xml']
- //link[@rel='alternate'][@type='application/rdf+xml']
- //link[@rel='alternate'][@type='application/rss+xml']