From 059de101b4aecb83265416d06364ce914cce6bf7 Mon Sep 17 00:00:00 2001 From: Ted Unangst Date: Fri, 13 Dec 2019 17:59:53 -0500 Subject: [PATCH] update the hooter --- go.mod | 2 +- go.sum | 4 ++-- hoot.go | 5 ++++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 42f2786..2d45b6d 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ require ( golang.org/x/crypto v0.0.0-20190621222207-cc06ce4a13d4 golang.org/x/net v0.0.0-20190620200207-3b0461eec859 humungus.tedunangst.com/r/go-sqlite3 v1.1.3 - humungus.tedunangst.com/r/webs v0.6.26 + humungus.tedunangst.com/r/webs v0.6.31 ) go 1.11 diff --git a/go.sum b/go.sum index ed46fd3..fdec52a 100644 --- a/go.sum +++ b/go.sum @@ -22,5 +22,5 @@ golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= humungus.tedunangst.com/r/go-sqlite3 v1.1.3 h1:G2N4wzDS0NbuvrZtQJhh4F+3X+s7BF8b9ga8k38geUI= humungus.tedunangst.com/r/go-sqlite3 v1.1.3/go.mod h1:FtEEmQM7U2Ey1TuEEOyY1BmphTZnmiEjPsNLEAkpf/M= -humungus.tedunangst.com/r/webs v0.6.26 h1:JgF+WhY6zvhXhRdqALPIWKTwzvwkCtD1eBB5fRzIKN8= -humungus.tedunangst.com/r/webs v0.6.26/go.mod h1:S9sXpVSbgAIa24yYhnMN0C94LKHG+2rioS+NsiDimps= +humungus.tedunangst.com/r/webs v0.6.31 h1:xDgtESuVljephZA4GfcycwiOwJeeJYUIQbStFHceN1Y= +humungus.tedunangst.com/r/webs v0.6.31/go.mod h1:S9sXpVSbgAIa24yYhnMN0C94LKHG+2rioS+NsiDimps= diff --git a/hoot.go b/hoot.go index ae21b67..a4b3f53 100644 --- a/hoot.go +++ b/hoot.go @@ -53,6 +53,9 @@ func hootextractor(r io.Reader, url string, seen map[string]bool) string { fmt.Fprintf(&buf, "%s\n", url) var htf htfilter.Filter + htf.Imager = func(node *html.Node) string { + return "" + } for _, div := range divs { twp := div.Parent.Parent.Parent alink := linksel.MatchFirst(twp) @@ -77,7 +80,7 @@ func hootextractor(r io.Reader, url string, seen map[string]bool) string { if author != wanted { continue } - text := htf.TextOnly(div) + text := htf.NodeText(div) text = strings.Replace(text, "\n", " ", -1) text = strings.Replace(text, "pic.twitter.com", "https://pic.twitter.com", -1)