Class: RSSable::Detection::FeedFinder

Inherits:
Object
  • Object
show all
Defined in:
lib/rssable/detection/feed_finder.rb

Class Method Summary collapse

Class Method Details

.call(url:) ⇒ Array<String>

It returns array of RSS feed links for given URL

Returns:

  • (Array<String>)


7
8
9
10
11
12
# File 'lib/rssable/detection/feed_finder.rb', line 7

def self.call(url:)
  response = RestClient.get(url)
  html = Nokogiri::HTML(response.body)

  html.css("link[type='application/rss+xml']").map { |node| node[:href] }
end