revise hoot match to exclude translations. from coelacanth
Ted Unangst tedu@tedunangst.com
Sun, 07 Aug 2022 16:02:58 -0400
1 files changed,
3 insertions(+),
3 deletions(-)
jump to
M
hoot.go
→
hoot.go
@@ -28,7 +28,7 @@ "golang.org/x/net/html"
"humungus.tedunangst.com/r/webs/htfilter" ) -var tweetsel = cascadia.MustCompile("div[itemProp=articleBody]") +var tweetsel = cascadia.MustCompile("div[data-testid=tweetText]") var linksel = cascadia.MustCompile("a time") var replyingto = cascadia.MustCompile(".ReplyingToContextBelowAuthor") var imgsel = cascadia.MustCompile("div[data-testid=tweetPhoto] img")@@ -66,7 +66,7 @@
divs := tweetsel.MatchAll(root) for i, div := range divs { { - twp := div.Parent.Parent.Parent + twp := div.Parent.Parent.Parent.Parent.Parent link := url alink := linksel.MatchFirst(twp) if alink == nil {@@ -100,7 +100,7 @@ fmt.Fprintf(&buf, "> @%s: %s\n", author, text)
continue } - twp := div.Parent.Parent.Parent + twp := div.Parent.Parent.Parent.Parent.Parent link := url alink := linksel.MatchFirst(twp) if alink == nil {