Sha256: 6c58918d295dee216d5572dacf446c832e80e65e3200b7b59d27b12ea76ff2b0

Contents?: true

Size: 614 Bytes

Versions: 2

Compression:

Stored size: 614 Bytes

Contents

# frozen_string_literal: true

module Ryo
  module Plugin
    module Subdomain
      class FindSubDomains < Base
        def endpoint
          "https://findsubdomains.com/subdomains-of"
        end

        def parse
          table = doc.at_css("table#table-view")
          return [] if table.nil?

          table.css("tr")[1..-1].map do |row|
            cols = row.css("td")
            domain = cols.first.at_css("a")&.text&.strip
            ip = cols[1].at_css("a").nil? ? "N/A" : cols[1].at_css("a").text.strip
            { domain: domain, ip: ip }
          end
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ryo-0.3.2 lib/ryo/plugin/subdomain/find_subdomains.rb
ryo-0.3.1 lib/ryo/plugin/subdomain/find_subdomains.rb