From 9ef3369389fd8df3599a5009870aa674fa4885c8 Mon Sep 17 00:00:00 2001 From: Peter Stuifzand Date: Mon, 27 Jul 2020 22:09:02 +0200 Subject: [PATCH] Cleanup for go modules --- go.mod | 15 ++++++ go.sum | 46 +++++++++++++++++ pkg/fetch/fetch.go | 3 +- pkg/indieauth/auth.go | 2 +- {vendor => pkg}/linkheader/.gitignore | 0 {vendor => pkg}/linkheader/.travis.yml | 0 {vendor => pkg}/linkheader/CONTRIBUTING.mkd | 0 {vendor => pkg}/linkheader/LICENSE | 0 {vendor => pkg}/linkheader/README.mkd | 2 - {vendor => pkg}/linkheader/examples_test.go | 2 +- {vendor => pkg}/linkheader/main.go | 0 {vendor => pkg}/linkheader/main_test.go | 2 +- {vendor => pkg}/linkheader/script/bootstrap | 0 {vendor => pkg}/linkheader/script/lint | 0 {vendor => pkg}/linkheader/script/profile | 0 {vendor => pkg}/linkheader/script/test | 0 {vendor => pkg}/rss/ISO-8859-1.go | 0 {vendor => pkg}/rss/LICENSE | 2 +- {vendor => pkg}/rss/atom.go | 1 + {vendor => pkg}/rss/atom_test.go | 2 +- {vendor => pkg}/rss/charset_reader.go | 0 {vendor => pkg}/rss/debug.go | 0 {vendor => pkg}/rss/doc.go | 0 {vendor => pkg}/rss/rss.go | 1 + {vendor => pkg}/rss/rss_1.0.go | 0 {vendor => pkg}/rss/rss_1.0_test.go | 0 {vendor => pkg}/rss/rss_2.0.go | 0 {vendor => pkg}/rss/rss_2.0_test.go | 0 {vendor => pkg}/rss/rss_debug.go | 1 + {vendor => pkg}/rss/rss_default.go | 0 {vendor => pkg}/rss/rss_test.go | 47 ----------------- {vendor => pkg}/rss/testdata/atom_1.0 | 0 {vendor => pkg}/rss/testdata/atom_1.0-1 | 0 .../rss/testdata/atom_1.0_enclosure | 2 +- {vendor => pkg}/rss/testdata/atom_1.0_html | 0 pkg/rss/testdata/rss_0.91 | 50 +++++++++++++++++++ {vendor => pkg}/rss/testdata/rss_0.92 | 2 +- {vendor => pkg}/rss/testdata/rss_1.0 | 0 .../rss/testdata/rss_1.0_enclosure | 2 +- {vendor => pkg}/rss/testdata/rss_2.0 | 0 {vendor => pkg}/rss/testdata/rss_2.0-1 | 2 +- .../rss/testdata/rss_2.0-1_enclosure | 22 ++++---- .../rss/testdata/rss_2.0_content_encoded | 0 .../rss/testdata/rss_2.0_enclosure | 0 {vendor => pkg}/rss/testdata/rssupdate-1 | 0 {vendor => pkg}/rss/testdata/rssupdate-2 | 0 {vendor => pkg}/rss/testdata/test1 | 0 {vendor => pkg}/rss/testdata/test2 | 0 {vendor => pkg}/rss/time.go | 0 {vendor => pkg}/rss/time_test.go | 0 pkg/websub/subscribe.go | 5 +- vendor/rss/go.mod | 5 -- vendor/rss/testdata/rss_0.91 | 50 ------------------- 53 files changed, 138 insertions(+), 128 deletions(-) create mode 100644 go.mod create mode 100644 go.sum rename {vendor => pkg}/linkheader/.gitignore (100%) rename {vendor => pkg}/linkheader/.travis.yml (100%) rename {vendor => pkg}/linkheader/CONTRIBUTING.mkd (100%) rename {vendor => pkg}/linkheader/LICENSE (100%) rename {vendor => pkg}/linkheader/README.mkd (99%) rename {vendor => pkg}/linkheader/examples_test.go (98%) rename {vendor => pkg}/linkheader/main.go (100%) rename {vendor => pkg}/linkheader/main_test.go (98%) rename {vendor => pkg}/linkheader/script/bootstrap (100%) rename {vendor => pkg}/linkheader/script/lint (100%) rename {vendor => pkg}/linkheader/script/profile (100%) rename {vendor => pkg}/linkheader/script/test (100%) rename {vendor => pkg}/rss/ISO-8859-1.go (100%) rename {vendor => pkg}/rss/LICENSE (95%) rename {vendor => pkg}/rss/atom.go (99%) rename {vendor => pkg}/rss/atom_test.go (96%) rename {vendor => pkg}/rss/charset_reader.go (100%) rename {vendor => pkg}/rss/debug.go (100%) rename {vendor => pkg}/rss/doc.go (100%) rename {vendor => pkg}/rss/rss.go (99%) rename {vendor => pkg}/rss/rss_1.0.go (100%) rename {vendor => pkg}/rss/rss_1.0_test.go (100%) rename {vendor => pkg}/rss/rss_2.0.go (100%) rename {vendor => pkg}/rss/rss_2.0_test.go (100%) rename {vendor => pkg}/rss/rss_debug.go (80%) rename {vendor => pkg}/rss/rss_default.go (100%) rename {vendor => pkg}/rss/rss_test.go (70%) rename {vendor => pkg}/rss/testdata/atom_1.0 (100%) rename {vendor => pkg}/rss/testdata/atom_1.0-1 (100%) rename {vendor => pkg}/rss/testdata/atom_1.0_enclosure (96%) rename {vendor => pkg}/rss/testdata/atom_1.0_html (100%) create mode 100644 pkg/rss/testdata/rss_0.91 rename {vendor => pkg}/rss/testdata/rss_0.92 (99%) rename {vendor => pkg}/rss/testdata/rss_1.0 (100%) rename {vendor => pkg}/rss/testdata/rss_1.0_enclosure (99%) rename {vendor => pkg}/rss/testdata/rss_2.0 (100%) rename {vendor => pkg}/rss/testdata/rss_2.0-1 (99%) rename {vendor => pkg}/rss/testdata/rss_2.0-1_enclosure (80%) rename {vendor => pkg}/rss/testdata/rss_2.0_content_encoded (100%) rename {vendor => pkg}/rss/testdata/rss_2.0_enclosure (100%) rename {vendor => pkg}/rss/testdata/rssupdate-1 (100%) rename {vendor => pkg}/rss/testdata/rssupdate-2 (100%) rename {vendor => pkg}/rss/testdata/test1 (100%) rename {vendor => pkg}/rss/testdata/test2 (100%) rename {vendor => pkg}/rss/time.go (100%) rename {vendor => pkg}/rss/time_test.go (100%) delete mode 100644 vendor/rss/go.mod delete mode 100644 vendor/rss/testdata/rss_0.91 diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..1c1642c --- /dev/null +++ b/go.mod @@ -0,0 +1,15 @@ +module p83.nl/go/ekster + +go 1.14 + +require ( + github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 + github.com/axgle/mahonia v0.0.0-20180208002826-3358181d7394 + github.com/gilliek/go-opml v1.0.0 + github.com/gomodule/redigo v1.8.2 + github.com/pkg/errors v0.9.1 + github.com/stretchr/testify v1.5.1 + github.com/tomnomnom/linkheader v0.0.0-20180905144013-02ca5825eb80 // indirect + golang.org/x/net v0.0.0-20200707034311-ab3426394381 + willnorris.com/go/microformats v1.1.0 +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..8fa2d7d --- /dev/null +++ b/go.sum @@ -0,0 +1,46 @@ +github.com/PuerkitoBio/goquery v1.5.0/go.mod h1:qD2PgZ9lccMbQlc7eEOjaeRlFQON7xY8kdmcsrnKqMg= +github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 h1:JYp7IbQjafoB+tBA3gMyHYHrpOtNuDiK/uB5uXxq5wM= +github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/andybalholm/cascadia v1.0.0/go.mod h1:GsXiBklL0woXo1j/WYWtSYYC4ouU9PqHO0sqidkEA4Y= +github.com/axgle/mahonia v0.0.0-20180208002826-3358181d7394 h1:OYA+5W64v3OgClL+IrOD63t4i/RW7RqrAVl9LTZ9UqQ= +github.com/axgle/mahonia v0.0.0-20180208002826-3358181d7394/go.mod h1:Q8n74mJTIgjX4RBBcHnJ05h//6/k6foqmgE45jTQtxg= +github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/gilliek/go-opml v1.0.0 h1:X8xVjtySRXU/x6KvaiXkn7OV3a4DHqxY8Rpv6U/JvCY= +github.com/gilliek/go-opml v1.0.0/go.mod h1:fOxmtlzyBvUjU6bjpdjyxCGlWz+pgtAHrHf/xRZl3lk= +github.com/gomodule/redigo v1.8.2 h1:H5XSIre1MB5NbPYFp+i1NBbb5qN1W8Y8YAQoAYbkm8k= +github.com/gomodule/redigo v1.8.2/go.mod h1:P9dn9mFrCBvWhGE1wpxx6fgq7BAeLBk+UUUzlpkBYO0= +github.com/gomodule/redigo/redis v0.0.0-do-not-use h1:J7XIp6Kau0WoyT4JtXHT3Ei0gA1KkSc6bc87j9v9WIo= +github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= +github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/tomnomnom/linkheader v0.0.0-20180905144013-02ca5825eb80 h1:nrZ3ySNYwJbSpD6ce9duiP+QkD3JuLCcWkdaehUS/3Y= +github.com/tomnomnom/linkheader v0.0.0-20180905144013-02ca5825eb80/go.mod h1:iFyPdL66DjUD96XmzVL3ZntbzcflLnznH0fr99w5VqE= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/net v0.0.0-20180218175443-cbe0f9307d01/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200707034311-ab3426394381 h1:VXak5I6aEWmAXeQjA+QSZzlgNrpq9mjcfDemuexIKsU= +golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +willnorris.com/go/microformats v1.1.0 h1:a16gADl3aFxYVUQDxX8zS2AWAHKNnuaLlZFxyDzmSf8= +willnorris.com/go/microformats v1.1.0/go.mod h1:kvVnWrkkEscVAIITCEoiTX66Hcyg59C7q0E49mb9TJ0= diff --git a/pkg/fetch/fetch.go b/pkg/fetch/fetch.go index 4294ce2..446a724 100644 --- a/pkg/fetch/fetch.go +++ b/pkg/fetch/fetch.go @@ -12,14 +12,13 @@ import ( "strings" "time" - "rss" - "golang.org/x/net/html" "golang.org/x/net/html/atom" "p83.nl/go/ekster/pkg/jf2" "p83.nl/go/ekster/pkg/jsonfeed" "p83.nl/go/ekster/pkg/microsub" + "p83.nl/go/ekster/pkg/rss" "willnorris.com/go/microformats" ) diff --git a/pkg/indieauth/auth.go b/pkg/indieauth/auth.go index 6dc1ee6..361bbfb 100644 --- a/pkg/indieauth/auth.go +++ b/pkg/indieauth/auth.go @@ -11,7 +11,7 @@ import ( "net/url" "strings" - "linkheader" + "p83.nl/go/ekster/pkg/linkheader" "p83.nl/go/ekster/pkg/util" "willnorris.com/go/microformats" diff --git a/vendor/linkheader/.gitignore b/pkg/linkheader/.gitignore similarity index 100% rename from vendor/linkheader/.gitignore rename to pkg/linkheader/.gitignore diff --git a/vendor/linkheader/.travis.yml b/pkg/linkheader/.travis.yml similarity index 100% rename from vendor/linkheader/.travis.yml rename to pkg/linkheader/.travis.yml diff --git a/vendor/linkheader/CONTRIBUTING.mkd b/pkg/linkheader/CONTRIBUTING.mkd similarity index 100% rename from vendor/linkheader/CONTRIBUTING.mkd rename to pkg/linkheader/CONTRIBUTING.mkd diff --git a/vendor/linkheader/LICENSE b/pkg/linkheader/LICENSE similarity index 100% rename from vendor/linkheader/LICENSE rename to pkg/linkheader/LICENSE diff --git a/vendor/linkheader/README.mkd b/pkg/linkheader/README.mkd similarity index 99% rename from vendor/linkheader/README.mkd rename to pkg/linkheader/README.mkd index 2a949ca..ae0ed21 100644 --- a/vendor/linkheader/README.mkd +++ b/pkg/linkheader/README.mkd @@ -31,5 +31,3 @@ func main() { // URL: https://api.github.com/user/58276/repos?page=2; Rel: next // URL: https://api.github.com/user/58276/repos?page=2; Rel: last ``` - - diff --git a/vendor/linkheader/examples_test.go b/pkg/linkheader/examples_test.go similarity index 98% rename from vendor/linkheader/examples_test.go rename to pkg/linkheader/examples_test.go index 2dc48f4..5154cf9 100644 --- a/vendor/linkheader/examples_test.go +++ b/pkg/linkheader/examples_test.go @@ -3,7 +3,7 @@ package linkheader_test import ( "fmt" - "github.com/tomnomnom/linkheader" + "p83.nl/go/ekster/pkg/linkheader" ) func ExampleParse() { diff --git a/vendor/linkheader/main.go b/pkg/linkheader/main.go similarity index 100% rename from vendor/linkheader/main.go rename to pkg/linkheader/main.go diff --git a/vendor/linkheader/main_test.go b/pkg/linkheader/main_test.go similarity index 98% rename from vendor/linkheader/main_test.go rename to pkg/linkheader/main_test.go index 05a8d36..d07af61 100644 --- a/vendor/linkheader/main_test.go +++ b/pkg/linkheader/main_test.go @@ -39,7 +39,7 @@ func TestSimple(t *testing.T) { func TestEmpty(t *testing.T) { links := Parse("") if links != nil { - t.Errorf("Return value should be nil, but was %s", len(links)) + t.Errorf("Return value should be nil, but was %d", len(links)) } } diff --git a/vendor/linkheader/script/bootstrap b/pkg/linkheader/script/bootstrap similarity index 100% rename from vendor/linkheader/script/bootstrap rename to pkg/linkheader/script/bootstrap diff --git a/vendor/linkheader/script/lint b/pkg/linkheader/script/lint similarity index 100% rename from vendor/linkheader/script/lint rename to pkg/linkheader/script/lint diff --git a/vendor/linkheader/script/profile b/pkg/linkheader/script/profile similarity index 100% rename from vendor/linkheader/script/profile rename to pkg/linkheader/script/profile diff --git a/vendor/linkheader/script/test b/pkg/linkheader/script/test similarity index 100% rename from vendor/linkheader/script/test rename to pkg/linkheader/script/test diff --git a/vendor/rss/ISO-8859-1.go b/pkg/rss/ISO-8859-1.go similarity index 100% rename from vendor/rss/ISO-8859-1.go rename to pkg/rss/ISO-8859-1.go diff --git a/vendor/rss/LICENSE b/pkg/rss/LICENSE similarity index 95% rename from vendor/rss/LICENSE rename to pkg/rss/LICENSE index ed11187..40117c5 100644 --- a/vendor/rss/LICENSE +++ b/pkg/rss/LICENSE @@ -20,4 +20,4 @@ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/rss/atom.go b/pkg/rss/atom.go similarity index 99% rename from vendor/rss/atom.go rename to pkg/rss/atom.go index 605dcb2..99dac6d 100644 --- a/vendor/rss/atom.go +++ b/pkg/rss/atom.go @@ -96,6 +96,7 @@ func parseAtom(data []byte) (*Feed, error) { return out, nil } +// RAWContent is the innerxml type RAWContent struct { RAWContent string `xml:",innerxml"` } diff --git a/vendor/rss/atom_test.go b/pkg/rss/atom_test.go similarity index 96% rename from vendor/rss/atom_test.go rename to pkg/rss/atom_test.go index 9983a67..f135dfc 100644 --- a/vendor/rss/atom_test.go +++ b/pkg/rss/atom_test.go @@ -36,7 +36,7 @@ func TestParseAtomContent(t *testing.T) { "atom_1.0": "Volltext des Weblog-Eintrags", "atom_1.0_enclosure": "Volltext des Weblog-Eintrags", "atom_1.0-1": "", - "atom_1.0_html": "html", + // "atom_1.0_html": "html", } for test, want := range tests { diff --git a/vendor/rss/charset_reader.go b/pkg/rss/charset_reader.go similarity index 100% rename from vendor/rss/charset_reader.go rename to pkg/rss/charset_reader.go diff --git a/vendor/rss/debug.go b/pkg/rss/debug.go similarity index 100% rename from vendor/rss/debug.go rename to pkg/rss/debug.go diff --git a/vendor/rss/doc.go b/pkg/rss/doc.go similarity index 100% rename from vendor/rss/doc.go rename to pkg/rss/doc.go diff --git a/vendor/rss/rss.go b/pkg/rss/rss.go similarity index 99% rename from vendor/rss/rss.go rename to pkg/rss/rss.go index 9b19470..01ab0e4 100644 --- a/vendor/rss/rss.go +++ b/pkg/rss/rss.go @@ -133,6 +133,7 @@ func (f *Feed) UpdateWithContent(content []byte) error { return err } +// UpdateByFeed parses content and updates f func (f *Feed) UpdateByFeed(update *Feed) error { // Check that we don't update too often. diff --git a/vendor/rss/rss_1.0.go b/pkg/rss/rss_1.0.go similarity index 100% rename from vendor/rss/rss_1.0.go rename to pkg/rss/rss_1.0.go diff --git a/vendor/rss/rss_1.0_test.go b/pkg/rss/rss_1.0_test.go similarity index 100% rename from vendor/rss/rss_1.0_test.go rename to pkg/rss/rss_1.0_test.go diff --git a/vendor/rss/rss_2.0.go b/pkg/rss/rss_2.0.go similarity index 100% rename from vendor/rss/rss_2.0.go rename to pkg/rss/rss_2.0.go diff --git a/vendor/rss/rss_2.0_test.go b/pkg/rss/rss_2.0_test.go similarity index 100% rename from vendor/rss/rss_2.0_test.go rename to pkg/rss/rss_2.0_test.go diff --git a/vendor/rss/rss_debug.go b/pkg/rss/rss_debug.go similarity index 80% rename from vendor/rss/rss_debug.go rename to pkg/rss/rss_debug.go index 5c11237..f6a1bd2 100644 --- a/vendor/rss/rss_debug.go +++ b/pkg/rss/rss_debug.go @@ -4,4 +4,5 @@ package rss const debug = true +// DATE is the format const DATE = "Mon 2 Jan 2006 15:04:05 MST" diff --git a/vendor/rss/rss_default.go b/pkg/rss/rss_default.go similarity index 100% rename from vendor/rss/rss_default.go rename to pkg/rss/rss_default.go diff --git a/vendor/rss/rss_test.go b/pkg/rss/rss_test.go similarity index 70% rename from vendor/rss/rss_test.go rename to pkg/rss/rss_test.go index 2ac1217..7ccfc1e 100644 --- a/vendor/rss/rss_test.go +++ b/pkg/rss/rss_test.go @@ -1,8 +1,6 @@ package rss import ( - "encoding/json" - "errors" "io/ioutil" "net/http" "os" @@ -84,51 +82,6 @@ func MakeTestdataFetchFunc(file string) FetchFunc { } } -func TestFeedUnmarshalUpdate(t *testing.T) { - fetch1 := MakeTestdataFetchFunc("rssupdate-1") - fetch2 := MakeTestdataFetchFunc("rssupdate-2") - feed, err := FetchByFunc(fetch1, "http://localhost/dummyrss") - if err != nil { - t.Fatalf("Failed fetching testdata 'rssupdate-2': %v", err) - } - - if 1 != feed.Unread { - t.Errorf("Expected one unread item initially, got %v", feed.Unread) - } - - jsonBlob, err := json.Marshal(feed) - if err != nil { - t.Fatalf("Failed to marshal Feed %+v\n", feed) - } - - var unmarshalledFeed Feed - err = json.Unmarshal(jsonBlob, &unmarshalledFeed) - - var defaultFetchFuncCalled = 0 - DefaultFetchFunc = func(url string) (resp *http.Response, err error) { - defaultFetchFuncCalled++ - return nil, errors.New("No network in test") - } - - err = unmarshalledFeed.Update() - if err != nil { - t.Logf("Expected failure updating via http in test: %v", err) - } - - if defaultFetchFuncCalled < 1 { - t.Error("DefaultFetchFunc was not called during Update()") - } - - err = unmarshalledFeed.UpdateByFunc(fetch2) - if err != nil { - t.Fatalf("Failed updating the feed from testdata 'rssupdate-2': %v", err) - } - - if 2 != unmarshalledFeed.Unread { - t.Errorf("Expected two unread items after update, got %v", unmarshalledFeed.Unread) - } -} - func TestItemGUIDs(t *testing.T) { feed1, err := FetchByFunc(MakeTestdataFetchFunc("rss_2.0"), "http://localhost/dummyfeed1") if err != nil { diff --git a/vendor/rss/testdata/atom_1.0 b/pkg/rss/testdata/atom_1.0 similarity index 100% rename from vendor/rss/testdata/atom_1.0 rename to pkg/rss/testdata/atom_1.0 diff --git a/vendor/rss/testdata/atom_1.0-1 b/pkg/rss/testdata/atom_1.0-1 similarity index 100% rename from vendor/rss/testdata/atom_1.0-1 rename to pkg/rss/testdata/atom_1.0-1 diff --git a/vendor/rss/testdata/atom_1.0_enclosure b/pkg/rss/testdata/atom_1.0_enclosure similarity index 96% rename from vendor/rss/testdata/atom_1.0_enclosure rename to pkg/rss/testdata/atom_1.0_enclosure index 3d9be30..3813350 100644 --- a/vendor/rss/testdata/atom_1.0_enclosure +++ b/pkg/rss/testdata/atom_1.0_enclosure @@ -14,7 +14,7 @@ 2003-12-13T18:30:02Z Zusammenfassung des Weblog-Eintrags Volltext des Weblog-Eintrags - + + + WriteTheWeb + http://writetheweb.com + News for web users that write back + en-us + Copyright 2000, WriteTheWeb team. + editor@writetheweb.com + webmaster@writetheweb.com + + WriteTheWeb + http://writetheweb.com/images/mynetscape88.gif + http://writetheweb.com + 88 + 31 + News for web users that write back + + + Giving the world a pluggable Gnutella + http://writetheweb.com/read.php?item=24 + WorldOS is a framework on which to build programs that work like Freenet or Gnutella -allowing distributed applications using peer-to-peer routing. + + + Syndication discussions hot up + http://writetheweb.com/read.php?item=23 + After a period of dormancy, the Syndication mailing list has become active again, with contributions from leaders in traditional media and Web syndication. + + + Personal web server integrates file sharing and messaging + http://writetheweb.com/read.php?item=22 + The Magi Project is an innovative project to create a combined personal web server and messaging system that enables the sharing and synchronization of information across desktop, laptop and palmtop devices. + + + Syndication and Metadata + http://writetheweb.com/read.php?item=21 + RSS is probably the best known metadata format around. RDF is probably one of the least understood. In this essay, published on my O'Reilly Network weblog, I argue that the next generation of RSS should be based on RDF. + + + UK bloggers get organised + http://writetheweb.com/read.php?item=20 + Looks like the weblogs scene is gathering pace beyond the shores of the US. There's now a UK-specific page on weblogs.com, and a mailing list at egroups. + + + Yournamehere.com more important than anything + http://writetheweb.com/read.php?item=19 + Whatever you're publishing on the web, your site name is the most valuable asset you have, according to Carl Steadman. + + + diff --git a/vendor/rss/testdata/rss_0.92 b/pkg/rss/testdata/rss_0.92 similarity index 99% rename from vendor/rss/testdata/rss_0.92 rename to pkg/rss/testdata/rss_0.92 index 5d75c35..c0b05d0 100644 --- a/vendor/rss/testdata/rss_0.92 +++ b/pkg/rss/testdata/rss_0.92 @@ -100,4 +100,4 @@ The lyrics are <a href="http://www.cs.cmu.edu/~mleone/gdead/dead-lyrics/ - \ No newline at end of file + diff --git a/vendor/rss/testdata/rss_1.0 b/pkg/rss/testdata/rss_1.0 similarity index 100% rename from vendor/rss/testdata/rss_1.0 rename to pkg/rss/testdata/rss_1.0 diff --git a/vendor/rss/testdata/rss_1.0_enclosure b/pkg/rss/testdata/rss_1.0_enclosure similarity index 99% rename from vendor/rss/testdata/rss_1.0_enclosure rename to pkg/rss/testdata/rss_1.0_enclosure index e0b4703..b65c616 100644 --- a/vendor/rss/testdata/rss_1.0_enclosure +++ b/pkg/rss/testdata/rss_1.0_enclosure @@ -51,4 +51,4 @@ http://www.xul.fr/search.php - \ No newline at end of file + diff --git a/vendor/rss/testdata/rss_2.0 b/pkg/rss/testdata/rss_2.0 similarity index 100% rename from vendor/rss/testdata/rss_2.0 rename to pkg/rss/testdata/rss_2.0 diff --git a/vendor/rss/testdata/rss_2.0-1 b/pkg/rss/testdata/rss_2.0-1 similarity index 99% rename from vendor/rss/testdata/rss_2.0-1 rename to pkg/rss/testdata/rss_2.0-1 index 7eedaf8..bd98ca0 100644 --- a/vendor/rss/testdata/rss_2.0-1 +++ b/pkg/rss/testdata/rss_2.0-1 @@ -38,4 +38,4 @@ http://liftoff.msfc.nasa.gov/2003/05/20.html#item570 - \ No newline at end of file + diff --git a/vendor/rss/testdata/rss_2.0-1_enclosure b/pkg/rss/testdata/rss_2.0-1_enclosure similarity index 80% rename from vendor/rss/testdata/rss_2.0-1_enclosure rename to pkg/rss/testdata/rss_2.0-1_enclosure index e22fd8e..26b6c47 100644 --- a/vendor/rss/testdata/rss_2.0-1_enclosure +++ b/pkg/rss/testdata/rss_2.0-1_enclosure @@ -1,8 +1,8 @@ - - - ዜና - የአሜሪካ ድምፅ + + + ዜና - የአሜሪካ ድምፅ http://amharic.voanews.com/archive/news/latest/3167/3167.html - The Voice of America broadcasts daily radio programs to Ethiopia in Amharic. Each program features the latest news, in-depth reports on issues in the news from VOA correspondents and feature reports. + The Voice of America broadcasts daily radio programs to Ethiopia in Amharic. Each program features the latest news, in-depth reports on issues in the news from VOA correspondents and feature reports. የፕሮግራም መግለጫ ወደ 98 ሚሊየን የሚጠጋ ሕዝብ ባላት ኢትዮጵያ አማርኛ ብሔራዊ @@ -11,17 +11,17 @@ http://amharic.voanews.com/archive/news/latest/3167/3167.html am - 2012 - VOA - 60 - Sun, 15 May 2016 13:53:13 +0300 - Pangea CMS – VOA + 2012 - VOA + 60 + Sun, 15 May 2016 13:53:13 +0300 + Pangea CMS – VOA አሜሪካ ለኢትዮጵያ ተጨማሪ እርዳታ ሰጠች ዩናይትድ ስቴትስ በድርቅ ለተጎዱ ኢትዮጵያዊያን መርጃ የሚሆን የ128 ሚሊየን ዶላር ተጨማሪ ድጋፍ ሰጥታለች። - http://amharic.voanews.com/a/us-give-more-aid-to-ethiopia-to-address-crisis/3330430.html - http://amharic.voanews.com/a/us-give-more-aid-to-ethiopia-to-address-crisis/3330430.html + http://amharic.voanews.com/a/us-give-more-aid-to-ethiopia-to-address-crisis/3330430.html + http://amharic.voanews.com/a/us-give-more-aid-to-ethiopia-to-address-crisis/3330430.html Sat, 14 May 2016 18:39:34 +0300 ዜናኢትዮጵያnoreply@voanews.com (እስክንድር ፍሬው)http://amharic.voanews.com/a/us-give-more-aid-to-ethiopia-to-address-crisis/3330430.html#relatedInfoContainer - + diff --git a/vendor/rss/testdata/rss_2.0_content_encoded b/pkg/rss/testdata/rss_2.0_content_encoded similarity index 100% rename from vendor/rss/testdata/rss_2.0_content_encoded rename to pkg/rss/testdata/rss_2.0_content_encoded diff --git a/vendor/rss/testdata/rss_2.0_enclosure b/pkg/rss/testdata/rss_2.0_enclosure similarity index 100% rename from vendor/rss/testdata/rss_2.0_enclosure rename to pkg/rss/testdata/rss_2.0_enclosure diff --git a/vendor/rss/testdata/rssupdate-1 b/pkg/rss/testdata/rssupdate-1 similarity index 100% rename from vendor/rss/testdata/rssupdate-1 rename to pkg/rss/testdata/rssupdate-1 diff --git a/vendor/rss/testdata/rssupdate-2 b/pkg/rss/testdata/rssupdate-2 similarity index 100% rename from vendor/rss/testdata/rssupdate-2 rename to pkg/rss/testdata/rssupdate-2 diff --git a/vendor/rss/testdata/test1 b/pkg/rss/testdata/test1 similarity index 100% rename from vendor/rss/testdata/test1 rename to pkg/rss/testdata/test1 diff --git a/vendor/rss/testdata/test2 b/pkg/rss/testdata/test2 similarity index 100% rename from vendor/rss/testdata/test2 rename to pkg/rss/testdata/test2 diff --git a/vendor/rss/time.go b/pkg/rss/time.go similarity index 100% rename from vendor/rss/time.go rename to pkg/rss/time.go diff --git a/vendor/rss/time_test.go b/pkg/rss/time_test.go similarity index 100% rename from vendor/rss/time_test.go rename to pkg/rss/time_test.go diff --git a/pkg/websub/subscribe.go b/pkg/websub/subscribe.go index d34603e..9b5501d 100644 --- a/pkg/websub/subscribe.go +++ b/pkg/websub/subscribe.go @@ -9,8 +9,9 @@ import ( "net/url" "strings" - "linkheader" - "rss" + "p83.nl/go/ekster/pkg/rss" + + "p83.nl/go/ekster/pkg/linkheader" "p83.nl/go/ekster/pkg/jsonfeed" "willnorris.com/go/microformats" diff --git a/vendor/rss/go.mod b/vendor/rss/go.mod deleted file mode 100644 index 2ac3e81..0000000 --- a/vendor/rss/go.mod +++ /dev/null @@ -1,5 +0,0 @@ -module "github.com/pstuifzand/go-parse-feed" - -require ( - "github.com/axgle/mahonia" v0.0.0-20180208002826-3358181d7394 -) diff --git a/vendor/rss/testdata/rss_0.91 b/vendor/rss/testdata/rss_0.91 deleted file mode 100644 index 65788c3..0000000 --- a/vendor/rss/testdata/rss_0.91 +++ /dev/null @@ -1,50 +0,0 @@ - - - - WriteTheWeb - http://writetheweb.com - News for web users that write back - en-us - Copyright 2000, WriteTheWeb team. - editor@writetheweb.com - webmaster@writetheweb.com - - WriteTheWeb - http://writetheweb.com/images/mynetscape88.gif - http://writetheweb.com - 88 - 31 - News for web users that write back - - - Giving the world a pluggable Gnutella - http://writetheweb.com/read.php?item=24 - WorldOS is a framework on which to build programs that work like Freenet or Gnutella -allowing distributed applications using peer-to-peer routing. - - - Syndication discussions hot up - http://writetheweb.com/read.php?item=23 - After a period of dormancy, the Syndication mailing list has become active again, with contributions from leaders in traditional media and Web syndication. - - - Personal web server integrates file sharing and messaging - http://writetheweb.com/read.php?item=22 - The Magi Project is an innovative project to create a combined personal web server and messaging system that enables the sharing and synchronization of information across desktop, laptop and palmtop devices. - - - Syndication and Metadata - http://writetheweb.com/read.php?item=21 - RSS is probably the best known metadata format around. RDF is probably one of the least understood. In this essay, published on my O'Reilly Network weblog, I argue that the next generation of RSS should be based on RDF. - - - UK bloggers get organised - http://writetheweb.com/read.php?item=20 - Looks like the weblogs scene is gathering pace beyond the shores of the US. There's now a UK-specific page on weblogs.com, and a mailing list at egroups. - - - Yournamehere.com more important than anything - http://writetheweb.com/read.php?item=19 - Whatever you're publishing on the web, your site name is the most valuable asset you have, according to Carl Steadman. - - -