find favicons

This commit is contained in:
Nazar Kanaev 2021-03-18 11:30:01 +00:00
parent 1f042a8434
commit c896440525
3 changed files with 68 additions and 22 deletions

View file

@ -7,6 +7,15 @@ import (
"golang.org/x/net/html"
)
func any(els []string, el string, match func(string, string) bool) bool {
for _, x := range els {
if match(x, el) {
return true
}
}
return false
}
func getAttr(node *html.Node, key string) string {
for _, a := range node.Attr {
if a.Key == key {