all repos — honk @ 98a8585fc28cd27e9b942edac3fe0c35551e434d

my fork of honk

okay, now with the imgs
Ted Unangst tedu@tedunangst.com
Sun, 03 Jul 2022 16:17:18 -0400
commit

98a8585fc28cd27e9b942edac3fe0c35551e434d

parent

87d49d1d3d7a6b9564aa77230ff25d9a57af7291

1 files changed, 8 insertions(+), 1 deletions(-)

jump to
M hoot.gohoot.go

@@ -31,7 +31,7 @@

var tweetsel = cascadia.MustCompile("div[itemProp=articleBody]") var linksel = cascadia.MustCompile("a time") var replyingto = cascadia.MustCompile(".ReplyingToContextBelowAuthor") -var imgsel = cascadia.MustCompile("div.js-adaptive-photo img") +var imgsel = cascadia.MustCompile("div[data-testid=tweetPhoto] img") var authorregex = regexp.MustCompile("twitter.com/([^/]+)") var re_hoots = regexp.MustCompile(`hoot: ?https://\S+`)

@@ -84,8 +84,15 @@ dlog.Printf("no author?: %s", link)

continue } author := authormatch[1] + if wanted == "" { + wanted = author + } if author != wanted { continue + } + for _, img := range imgsel.MatchAll(twp) { + img.Parent.RemoveChild(img) + div.AppendChild(img) } text := htf.NodeText(div) text = strings.Replace(text, "\n", " ", -1)