Class: Miteru::Feeds::Ayashige

Inherits:
Feed
  • Object
show all
Defined in:
lib/miteru/feeds/ayashige.rb

Constant Summary collapse

HOST =
"ayashige.herokuapp.com"
URL =
"https://#{HOST}"

Constants included from Mixins::URL

Mixins::URL::IGNORE_EXTENSIONS

Instance Method Summary collapse

Methods inherited from Feed

#breakdowend_urls, #entries, #source

Methods included from Mixins::URL

#breakdown, #invalid_extension?

Instance Method Details

#urlsObject



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/miteru/feeds/ayashige.rb', line 12

def urls
  url = url_for("/api/v1/domains/")
  res = JSON.parse(get(url))

  domains = res.map { |item| item["fqdn"] }
  domains.map do |domain|
    [
      "https://#{domain}",
      "http://#{domain}"
    ]
  end.flatten
rescue HTTPResponseError, HTTP::Error, JSON::ParserError => e
  Miteru.logger.error "Failed to load ayashige feed (#{e})"
  []
end