From 6e76fff3b8d30745c9bafec7be2fa18fb1d16276 Mon Sep 17 00:00:00 2001 From: Ted Unangst Date: Fri, 27 Sep 2019 16:15:12 -0400 Subject: [PATCH] if we're trying to grab tweet replies, don't always use first as author --- hoot.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/hoot.go b/hoot.go index 41e348e..dd1e714 100644 --- a/hoot.go +++ b/hoot.go @@ -71,7 +71,11 @@ func hootfixer(r io.Reader, url string) string { } divs := tweetsel.MatchAll(root) - wanted := "" + wantmatch := authorregex.FindStringSubmatch(url) + if len(wantmatch) < 2 { + log.Printf("no wanted author?") + } + wanted := wantmatch[1] var buf strings.Builder filt := htfilter.New() @@ -90,9 +94,6 @@ func hootfixer(r io.Reader, url string) string { continue } author := authormatch[1] - if wanted == "" { - wanted = author - } if author != wanted { continue }