if we're trying to grab tweet replies, don't always use first as author

This commit is contained in:
Ted Unangst 2019-09-27 16:15:12 -04:00
parent 12b4bb9a52
commit 6e76fff3b8
1 changed files with 5 additions and 4 deletions

View File

@ -71,7 +71,11 @@ func hootfixer(r io.Reader, url string) string {
} }
divs := tweetsel.MatchAll(root) 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 var buf strings.Builder
filt := htfilter.New() filt := htfilter.New()
@ -90,9 +94,6 @@ func hootfixer(r io.Reader, url string) string {
continue continue
} }
author := authormatch[1] author := authormatch[1]
if wanted == "" {
wanted = author
}
if author != wanted { if author != wanted {
continue continue
} }