Sha256: 00d01107239cb4c545b09510a2e6591ee2036af3c9fb6c4ddd7254ff521307fc
Contents?: true
Size: 658 Bytes
Versions: 12
Compression:
Stored size: 658 Bytes
Contents
# frozen_string_literal: true require "json" require "uri" module Miteru class Feeds class Ayashige < Feed HOST = "ayashige.herokuapp.com" URL = "https://#{HOST}" def urls url = url_for("/feed") res = JSON.parse(get(url)) domains = res.map { |item| item["domain"] } domains.map do |domain| [ "https://#{domain}", "http://#{domain}" ] end.flatten rescue HTTPResponseError => e puts "Failed to load ayashige feed (#{e})" [] end private def url_for(path) URI(URL + path) end end end end
Version data entries
12 entries across 12 versions & 1 rubygems