Merge pull request #66 from leereilly/more-slds

Add a bunch of SLDs
This commit is contained in:
Aidan Feldman 2014-06-19 01:32:13 -04:00
commit 869b156ce5
3 changed files with 80 additions and 1 deletions

View File

@ -3,6 +3,7 @@ source "http://rubygems.org"
gem 'public_suffix'
group :development do
gem "nokogiri", "~> 1.5"
gem "rake", "~> 10.0"
gem "rdoc", "~> 3.12"
gem "bundler", "~> 1.5"

View File

@ -62,3 +62,35 @@ task :add, :sld, :tld, :name do |t, args|
end
end
end
task :quackit_import do
require 'nokogiri'
require 'open-uri'
require_relative File.join('lib', 'swot', 'academic_tlds')
new_domains = Set.new
doc = Nokogiri::HTML(open('http://www.quackit.com/domain-names/country_domain_extensions.cfm'))
doc.css('#content li').each do |li|
desc = li.content.split(/\s+-\s+/, 2)[1]
if desc =~ /academic|education|school/i
domain_el = li.at_css('b')
# some lines have more than one domain listed
domains = domain_el.content.split(/\s*\/\s*/)
domains.each do |domain|
# remove leading space
domain = domain.strip.sub(/\A\./, '')
unless Swot::ACADEMIC_TLDS.include?(domain)
# print out for manual review
puts "#{domain} - #{desc.strip.gsub(/\s+/, ' ')}"
new_domains << domain
end
end
end
end
puts "\nNEW DOMAINS (#{new_domains.size}):\n\n"
new_domains.each do |domain|
puts domain
end
end

View File

@ -7,25 +7,34 @@ module Swot
ac.at
ac.bd
ac.be
ac.cn
ac.cr
ac.cy
ac.fj
ac.gg
ac.gn
ac.id
ac.il
ac.in
ac.ir
ac.jp
ac.ke
ac.kr
ac.ma
ac.me
ac.mu
ac.mw
ac.mz
ac.ni
ac.nz
ac.om
ac.pa
ac.pg
ac.pr
ac.rs
ac.ru
ac.rw
ac.sz
ac.th
ac.tz
ac.ug
@ -34,6 +43,9 @@ module Swot
ac.za
ac.zm
ac.zw
ed.ao
ed.cr
ed.jp
edu
edu.af
edu.al
@ -51,6 +63,8 @@ module Swot
edu.bs
edu.bt
edu.bz
edu.ck
edu.cn
edu.co
edu.cu
edu.do
@ -68,6 +82,7 @@ module Swot
edu.hk
edu.hn
edu.ht
edu.in
edu.iq
edu.jm
edu.jo
@ -79,13 +94,19 @@ module Swot
edu.kz
edu.la
edu.lb
edu.lr
edu.lv
edu.ly
edu.me
edu.mg
edu.mk
edu.ml
edu.mm
edu.mn
edu.mo
edu.mt
edu.mv
edu.mw
edu.mx
edu.my
edu.ni
@ -99,13 +120,17 @@ module Swot
edu.pr
edu.ps
edu.pt
edu.pw
edu.py
edu.qa
edu.rs
edu.ru
edu.sa
edu.sc
edu.sd
edu.sg
edu.sh
edu.sl
edu.sv
edu.sy
edu.tr
@ -118,6 +143,27 @@ module Swot
edu.ws
edu.ye
edu.zm
es.kr
g12.br
hs.kr
ms.kr
sc.kr
sc.ug
sch.ae
sch.gg
sch.id
sch.ir
sch.je
sch.jo
sch.lk
sch.ly
sch.my
sch.om
sch.ps
sch.sa
sch.uk
school.nz
school.za
vic.edu.au
).to_set.freeze
end