4 ms·
Unrelated: did Hacker News mess up their eTLD+1 code? I see the link as going to "org.hk" :/
by saagarjha 7y ago
Unrelated: did Hacker News mess up their eTLD+1 code? I see the link as going to "org.hk" :/
- dear 7y agoHN only displays the top level domain, which is org.hk
- chipperyman573 7y agoI'm not sure I'm right, but isn't ork.hk the TLD? Similar to co.uk or com.cn
- thefifthsetpin 7y agoFor use cases like this, I generally pull from: https://publicsuffix.org/list/effective_tld_names.dat https://publicsuffix.org/list/effective_tld_names.dat They'd consider these to be the .hk TLD's: .hk com.hk edu.hk gov.hk idv.hk net.hk org.hk 公司.hk 教育.hk 敎育.hk 政府.hk 個人.hk 个人.hk 箇人.hk 網络.hk 网络.hk 组織.hk 網絡.hk 网絡.hk 组织.hk 組織.hk They also consider dreamhost.com to be a TLD, so it's probably not the right list for some other use cases.
- saagarjha 7y agoWhich looks like a bug, I take it, considering that this one shows up as going to "bbc.co.uk": https://news.ycombinator.com/item?id=20817583 https://news.ycombinator.com/item?id=20817583? (Also, I think the TLD is still just ".hk"; ".org.hk" is an eTLD AFAIK.)
- jasonjei 7y agoI’m guessing they probably only put in a handful of common country-level TLDs...
- deleted 7y ago[deleted]
- Deimorz 7y agoGenerally, the best way to handle this is using the public suffix list: https://publicsuffix.org/ https://publicsuffix.org/ org.hk is an entry in it, which means you should display the next section "up" from that, so that would be hkispa.org.hk as wanted here.
- peteretep 7y agoThe public suffix doesn't list .ac.uk or .go.th (because it only lists somewhere the general public can register) so it's not especially useful for working out if something is a toppish-level domain.
- acrispino 7y agoWhat's a useful method to do that?
- peteretep 7y agoNo idea for how you’d generate an exhaustive list, although one-off you could walk up a given URL’s host looking for A-records? You’d want some fail-safes there presumably. Perhaps you could do this with the common crawl db
- breakingcups 7y agoJust in case you didn't catch the other message, the public suffix list does in fact include the domains mentioned.
- Deimorz 7y agoIt includes both ac.uk and go.th. ac.uk: https://github.com/publicsuffix/list/blob/master/public_suffix_list.dat#L6380 https://github.com/publicsuffix/list/blob/master/public_suff... go.th: https://github.com/publicsuffix/list/blob/master/public_suffix_list.dat#L6120 https://github.com/publicsuffix/list/blob/master/public_suff...
- peteretep 7y ago