Sha256: 3e89abfdef38843b41c5f807e9c6ed62d6c5482725c198390a543525e212dd23
Contents?: true
Size: 1.29 KB
Versions: 390
Compression:
Stored size: 1.29 KB
Contents
#!/usr/bin/env ruby # frozen_string_literal: true require_relative "helpers" puts "=> Fetching tld list" tlds = http_request(:get, "https://data.iana.org/TLD/tlds-alpha-by-domain.txt").body.lines tlds.shift # remove update notice tlds = tlds .map(&:downcase) .map(&:strip) .map {|tld| SimpleIDN.to_ascii(tld) } puts "=> Saving tlds.txt" save_file("tlds.txt", normalize_list(tlds)) puts "=> Fetching country tld list" country_tlds = JSON.parse( http_request(:get, "https://github.com/samayo/country-json/raw/master/src/country-by-domain-tld.json").body, symbolize_names: true ) country_tlds = country_tlds .reject {|info| info[:tld].nil? } .map {|info| info[:tld].gsub(/^\./, "") } puts "=> Saving country_tlds.txt" save_file("country_tlds.txt", normalize_list(country_tlds)) puts "=> Fetching sld list" response = http_request(:get, "https://publicsuffix.org/list/public_suffix_list.dat") content, _ = response.body.split("END ICANN DOMAINS") slds = content .lines .map {|line| line.gsub(/^\*\./, "") } .map(&:strip) .reject(&:empty?) .reject {|line| line.start_with?("/") } .map {|line| line.gsub(/^([!*.]+)/, "") } .reject {|line| line.split(".").size == 1 } save_file("slds.txt", normalize_list(slds))
Version data entries
390 entries across 390 versions & 1 rubygems