all repos — honk @ 75e45575a2d365889a03d0c704e8cb1ce61e4518

my fork of honk

remove very old dead code which is confusing
Ted Unangst tedu@tedunangst.com
Sun, 19 Feb 2023 19:45:09 -0500
commit

75e45575a2d365889a03d0c704e8cb1ce61e4518

parent

c01ea21a29f8c98f662895b3132b6b100bf67219

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

jump to
M hoot.gohoot.go

@@ -67,41 +67,6 @@ fmt.Fprintf(&buf, "%s\n", url)

divs := tweetsel.MatchAll(root) for i, div := range divs { - { - twp := div.Parent.Parent.Parent.Parent.Parent - link := url - alink := linksel.MatchFirst(twp) - if alink == nil { - if i != 0 { - dlog.Printf("missing link") - continue - } - } else { - alink = alink.Parent - link = "https://twitter.com" + htfilter.GetAttr(alink, "href") - } - authormatch := authorregex.FindStringSubmatch(link) - if len(authormatch) < 2 { - 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) - fmt.Fprintf(&buf, "> @%s: %s\n", author, text) - continue - } - twp := div.Parent.Parent.Parent.Parent.Parent link := url alink := linksel.MatchFirst(twp)

@@ -111,12 +76,9 @@ dlog.Printf("missing link")

continue } } else { + alink = alink.Parent link = "https://twitter.com" + htfilter.GetAttr(alink, "href") } - replto := replyingto.MatchFirst(twp) - if replto != nil { - continue - } authormatch := authorregex.FindStringSubmatch(link) if len(authormatch) < 2 { dlog.Printf("no author?: %s", link)

@@ -135,14 +97,7 @@ div.AppendChild(img)

} text := htf.NodeText(div) text = strings.Replace(text, "\n", " ", -1) - text = re_removepics.ReplaceAllString(text, "") - - if seen[text] { - continue - } - fmt.Fprintf(&buf, "> @%s: %s\n", author, text) - seen[text] = true } return buf.String() }