Skip to content

Commit

Permalink
Ignore subdomain by using PublicSuffix gem #342
Browse files Browse the repository at this point in the history
  • Loading branch information
yasulab committed Jan 29, 2025
1 parent 854992d commit 47a84f9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ gem 'csv'
gem 'base64'
gem 'bigdecimal'
gem 'logger'
gem 'public_suffix'

group :development, :test do
gem 'html-proofer'
Expand Down
1 change: 1 addition & 0 deletions docs/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ DEPENDENCIES
jekyll-seo-tag
jekyll-sitemap
logger
public_suffix
rake
sanitize
support-for
Expand Down
3 changes: 2 additions & 1 deletion docs/upsert_data_by_readme.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
require 'git'
require 'kramdown'
require 'sanitize'
require 'public_suffix'

lang = ARGV[0] || 'en'
readme_path = if lang == 'en'
Expand Down Expand Up @@ -46,7 +47,7 @@
name_and_link = Kramdown::Document.new(cells[1]).root.children[0].children[0]
name = name_and_link.children[0].value.strip
link = name_and_link.attr['href']
domain = link.split('/')[2]
domain = PublicSuffix.domain(link.split('/')[2])
id = name.downcase # ID (v2)
.gsub('株式会社', '')
.gsub('inc.', '')
Expand Down

0 comments on commit 47a84f9

Please sign in to comment.