joeguo / tldextract Goto Github PK
View Code? Open in Web Editor NEWExtract root domain, subdomain name, and tld from a url, using the Public Suffix List.
License: MIT License
Extract root domain, subdomain name, and tld from a url, using the Public Suffix List.
License: MIT License
for some reason anything ending in "amazonaws.com" returns no data at all, change 1 letter and you get data.
I noticed that you're fetching the public suffix list over HTTP.
Is there a reliable HTTPS URL you can use for this instead? For example, https://publicsuffix.org/list/effective_tld_names.dat
Thanks!
We are getting following error retrieving public_suffix_list
x509: certificate has expired or is not yet valid: current time 2023-06-01T15:50:05Z is after 2021-09-30T14:01:15Z","timestamp":"2023-06-01T15:50:05Z"
Also, "curl" returns the same error.
Our Server configuration
"CentOS Linux" version 7
There seems to be an old issue reported on this but is marked as closed - publicsuffix/list#33
Please help!
The library is not parsing www.kafe.co.il
correctly. Relevant entries in the tld file:
blogspot.co.il
*.il
The following code doesn't produce the expected result, due to tldextract
's code checking for letters/digits/dash in the resulting domain name:
package main
import (
"fmt"
"github.com/joeguo/tldextract"
)
func main() {
cache := "/tmp/tld.cache"
extract, _ := tldextract.New(cache, true)
result:=extract.Extract("https://allestörungen.at/stoerung/upc/vienna")
fmt.Printf("%+v\n",result)
}
It does not parse correctly when the url is:
ec2-54-XXX-XXX-158.us-west-2.compute.amazonaws.com
This library does not properly parse wildcards, it seems:
Using the following code:
package main
import (
"github.com/joeguo/tldextract"
"fmt"
)
func main() {
var test string
var err error
tld, _:= tldextract.New("/tmp/tldcache.txt",false)
for err == nil {
fmt.Printf("string: ")
fmt.Scanf("%s\n", &test)
result := tld.Extract(test)
if result.Flag == tldextract.Malformed {
fmt.Println("Error", result)
} else {
fmt.Printf("%s.%s\n", result.Root, result.Tld)
}
}
}
I get:
string: http://foo.bar.com
bar.com
string: http://foo.co.uk
Error &{0 }
string: http://foo.*.uk
foo.*.uk
The "foo.*.uk" is most certainly incorrect.
Hello
When I run the program, it gives me this error
**```
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x8 pc=0x6c2204]
goroutine 1 [running]:
github.com/joeguo/tldextract.(*TLDExtract).getTldIndex(0xc00000a0c0?, {0xc0000ee030, 0x7221b2?, 0x1?})
C:/Users/Jorjjji/go/pkg/mod/github.com/joeguo/[email protected]/tldextract.go:172 +0x64
First of all, thanks for sharing a useful software!
Could you add LICENSE file?
The following site might help to choose a license.
http://choosealicense.com/
I hope you choose Permissive license like MIT or Apache 2.
Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.