Sha256: 0103ebe031cdd60094a2b3506d6d68c84f44708252174cd1a889ba4e5d4d7b10

Contents?: true

Size: 1.01 KB

Versions: 1

Compression:

Stored size: 1.01 KB

Contents

# frozen_string_literal: true

module SecurityTrails
  module Clients
    class Feeds < Client
      #
      # Fetch zone files including authoritative nameservers with ease
      #
      # @see https://docs.securitytrails.com/reference#domains-1
      #
      # @param [String] type valid values are "all", "dropped", "new" or "registered"
      # @param [String, nil] filter valid values are "cctld" and "gtld"
      # @param [String, nil] tld Can be used to only return domains of a specific tld, such as "com"
      # @param [Boolean, nil] ns show nameservers in the list
      # @param [String, nil] date Date to fetch data for, format YYYY-MM-DD,
      #
      # @return [<Type>] <description>
      #
      def domains(type, filter: nil, tld: nil, ns: nil, date: nil)
        params = { filter: filter, tld: tld, ns: ns, date: date }.compact

        get("/feeds/domains/#{type}", params) do |csv_gz|
          unziped_text = Utility.ungzip(csv_gz)
          unziped_text.lines.map(&:chomp)
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
securitytrails-1.0.0 lib/securitytrails/clients/feeds.rb