tweak hoot, less noise, log errors
Ted Unangst tedu@tedunangst.com
Tue, 03 Sep 2019 01:19:55 -0400
1 files changed,
6 insertions(+),
2 deletions(-)
jump to
M
hoot.go
→
hoot.go
@@ -64,13 +64,17 @@ return hootfixer(r, url)
} func hootfixer(r io.Reader, url string) string { - root, _ := html.Parse(r) + root, err := html.Parse(r) + if err != nil { + log.Printf("error parsing hoot: %s", err) + return url + } divs := tweetsel.MatchAll(root) wanted := "" var buf strings.Builder - fmt.Fprintf(&buf, "hoot: %s\n", url) + fmt.Fprintf(&buf, "%s\n", url) for _, div := range divs { twp := div.Parent.Parent.Parent alink := linksel.MatchFirst(twp)