don't need replies to yoyos in hoots
This commit is contained in:
parent
48513d3613
commit
a81ec6f628
5
hoot.go
5
hoot.go
|
@ -31,6 +31,7 @@ import (
|
|||
|
||||
var tweetsel = cascadia.MustCompile("p.tweet-text")
|
||||
var linksel = cascadia.MustCompile(".time a.tweet-timestamp")
|
||||
var replyingto = cascadia.MustCompile(".ReplyingToContextBelowAuthor")
|
||||
var authorregex = regexp.MustCompile("twitter.com/([^/]+)")
|
||||
|
||||
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")
|
||||
continue
|
||||
}
|
||||
replto := replyingto.MatchFirst(twp)
|
||||
if replto != nil {
|
||||
continue
|
||||
}
|
||||
link := "https://twitter.com" + htfilter.GetAttr(alink, "href")
|
||||
authormatch := authorregex.FindStringSubmatch(link)
|
||||
if len(authormatch) < 2 {
|
||||
|
|
Loading…
Reference in New Issue