Skip to content

Commit

Permalink
Add comment on ID generation
Browse files Browse the repository at this point in the history
  • Loading branch information
yasulab committed Jan 29, 2025
1 parent a4990f3 commit 1b5e15d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docs/upsert_data_by_readme.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@
name = name_and_link.children[0].value.strip
link = name_and_link.attr['href']
domain = PublicSuffix.domain(link.split('/')[2])

# ID needs to be unique. So `PublicSuffix.parse(domain).sld` does not work.
# https://github.com/weppos/publicsuffix-ruby#usage
id = domain.gsub('.', '_')

# The following`id` has been replaced with the `domain` above.
Expand Down

0 comments on commit 1b5e15d

Please sign in to comment.