Sha256: 17faa111bd466d48d423e66885c6b1813da2f3c16b68e44cae42368c5ee09746

Contents?: true

Size: 347 Bytes

Versions: 1

Compression:

Stored size: 347 Bytes

Contents

#!/usr/bin/env ruby
# frozen_string_literal: true

require "open-uri"
require "json"

tlds = open("https://data.iana.org/TLD/tlds-alpha-by-domain.txt").read.lines
tlds.shift # remove update notice

tlds.map!(&:downcase)
tlds.map!(&:strip)
tlds.sort!
tlds.uniq!

File.open("./data/tld.json", "w") do |file|
  file << JSON.pretty_generate(tlds)
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
validators-3.0.3 bin/sync-tld