Skip to content

Commit

Permalink
Find favicon in f.start.me
Browse files Browse the repository at this point in the history
  • Loading branch information
x1ah committed Apr 16, 2021
1 parent 9d011bb commit 5379c90
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ func (ws *WebStackGenerator) Run(cfg *Config) {

// icon return favicon of url
func icon(rawurl string) string {
duck := "https://icons.duckduckgo.com/ip3/%s.ico"
base := "https://f.start.me/%s"
rawurl = strings.TrimSpace(rawurl)
u, err := url.Parse(rawurl)
if err != nil {
return fmt.Sprintf(duck, "")
return fmt.Sprintf(base, "o.oo")
}
host := u.Host
if strings.Contains(host, ":") {
host, _, _ = net.SplitHostPort(host)
}
return fmt.Sprintf(duck, host)
return fmt.Sprintf(base, host)
}

0 comments on commit 5379c90

Please sign in to comment.