package main import ( "net/http" "net/url" "strings" "time" "github.com/go-shiori/go-readability" "golang.org/x/net/html" ) // fetchPageMetadata tries extracting title/description/keywords from standard HTML, // OG, Twitter, then falls back to go-readability if needed. If after all that we // still have no title or no description, we return ("", "", "") so the caller // can skip saving it. // // 1.
2 { return true } return false } // sanitize removes pipes and newlines so they don't break our output format. func sanitize(input string) string { input = strings.ReplaceAll(input, "|", " ") input = strings.ReplaceAll(input, "\n", " ") return strings.TrimSpace(input) }