Sha256: 52766f3bb474b50c21a5ce23412cd0f604e1d608efc4d11d16443c35f424a191

Contents?: true

Size: 556 Bytes

Versions: 3

Compression:

Stored size: 556 Bytes

Contents

# frozen_string_literal: true

require "json"
require "uri"

module Miteru
  class Feeds
    class PhishStats < Feed
      URL = "https://phishstats.info:2096/api/phishing?_sort=-id&size=100"

      def urls
        json = JSON.parse(get(URL))
        json.map do |entry|
          entry["url"]
        end
      rescue HTTPResponseError, HTTP::Error, JSON::ParserError => e
        Miteru.logger.error "Failed to load PhishStats feed (#{e})"
        []
      end

      private

      def url_for(path)
        URI(URL + path)
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
miteru-1.2.2 lib/miteru/feeds/phishstats.rb
miteru-1.2.1 lib/miteru/feeds/phishstats.rb
miteru-1.2.0 lib/miteru/feeds/phishstats.rb