don't need replies to yoyos in hoots

This commit is contained in:
Ted Unangst 2019-10-31 00:14:43 -04:00
parent 48513d3613
commit a81ec6f628
1 changed files with 5 additions and 0 deletions

View File

@ -31,6 +31,7 @@ import (
var tweetsel = cascadia.MustCompile("p.tweet-text") var tweetsel = cascadia.MustCompile("p.tweet-text")
var linksel = cascadia.MustCompile(".time a.tweet-timestamp") var linksel = cascadia.MustCompile(".time a.tweet-timestamp")
var replyingto = cascadia.MustCompile(".ReplyingToContextBelowAuthor")
var authorregex = regexp.MustCompile("twitter.com/([^/]+)") var authorregex = regexp.MustCompile("twitter.com/([^/]+)")
var re_hoots = regexp.MustCompile(`hoot: ?https://\S+`) var re_hoots = regexp.MustCompile(`hoot: ?https://\S+`)
@ -59,6 +60,10 @@ func hootextractor(r io.Reader, url string, seen map[string]bool) string {
log.Printf("missing link") log.Printf("missing link")
continue continue
} }
replto := replyingto.MatchFirst(twp)
if replto != nil {
continue
}
link := "https://twitter.com" + htfilter.GetAttr(alink, "href") link := "https://twitter.com" + htfilter.GetAttr(alink, "href")
authormatch := authorregex.FindStringSubmatch(link) authormatch := authorregex.FindStringSubmatch(link)
if len(authormatch) < 2 { if len(authormatch) < 2 {