From d0c18338f6bb25b07f43cf80d9ceede6ee66d88e Mon Sep 17 00:00:00 2001 From: Ted Unangst Date: Sun, 7 Aug 2022 16:02:58 -0400 Subject: [PATCH] revise hoot match to exclude translations. from coelacanth --- hoot.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hoot.go b/hoot.go index 27b3e00..f1f7ae9 100644 --- a/hoot.go +++ b/hoot.go @@ -28,7 +28,7 @@ import ( "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 @@ func hootextractor(r io.Reader, url string, seen map[string]bool) string { 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 @@ func hootextractor(r io.Reader, url string, seen map[string]bool) string { continue } - twp := div.Parent.Parent.Parent + twp := div.Parent.Parent.Parent.Parent.Parent link := url alink := linksel.MatchFirst(twp) if alink == nil {