Sha256: e73543d876258a9360b80d0c4a3cc36fa3f710fa0bb0bf4b4bcda78485e2dc40
Contents?: true
Size: 697 Bytes
Versions: 2
Compression:
Stored size: 697 Bytes
Contents
# frozen_string_literal: true require "json" require "uri" module Miteru class Feeds class Ayashige < Feed HOST = "ayashige.herokuapp.com" URL = "https://#{HOST}".freeze 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, HTTP::Error, JSON::ParserError => e puts "Failed to load ayashige feed (#{e})" [] end private def url_for(path) URI(URL + path) end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
miteru-1.0.1 | lib/miteru/feeds/ayashige.rb |
miteru-1.0.0 | lib/miteru/feeds/ayashige.rb |