From 4c35631633c69c9bdf1c1424682473b8fb4ceba0 Mon Sep 17 00:00:00 2001 From: ekzyis Date: Sun, 27 Aug 2023 23:42:10 +0200 Subject: [PATCH] Fix item lookup and item creation SN API changed. Had to update to sn-goapi v0.3.1 --- go.mod | 2 +- go.sum | 4 ++++ main.go | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index e1b3bc8..955ee6a 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module git.ekzyis.com/ekzyis/unpaywall go 1.21.0 require ( - github.com/ekzyis/sn-goapi v0.3.0 // indirect + github.com/ekzyis/sn-goapi v0.3.1 // indirect github.com/joho/godotenv v1.5.1 // indirect github.com/mattn/go-sqlite3 v1.14.17 // indirect github.com/namsral/flag v1.7.4-pre // indirect diff --git a/go.sum b/go.sum index 79f75ec..ba6b679 100644 --- a/go.sum +++ b/go.sum @@ -6,6 +6,10 @@ github.com/ekzyis/sn-goapi v0.2.1-0.20230823015232-6a259372b331 h1:NpCmANlADOcRY github.com/ekzyis/sn-goapi v0.2.1-0.20230823015232-6a259372b331/go.mod h1:FObbYr/NXgnXNWU+EwiWKoWQy+wAaRS6AoW3NgsJ/Oo= github.com/ekzyis/sn-goapi v0.3.0 h1:pXRbD2iAMHvUC/+gZKXPRwInP4PuABEC1qQc+DWARlE= github.com/ekzyis/sn-goapi v0.3.0/go.mod h1:FObbYr/NXgnXNWU+EwiWKoWQy+wAaRS6AoW3NgsJ/Oo= +github.com/ekzyis/sn-goapi v0.3.1-0.20230827213658-0ee21b998335 h1:Zl30HHHnM2LU0yXrrUUAGEGcSuoJXFcSt9ez0/tVPLI= +github.com/ekzyis/sn-goapi v0.3.1-0.20230827213658-0ee21b998335/go.mod h1:FObbYr/NXgnXNWU+EwiWKoWQy+wAaRS6AoW3NgsJ/Oo= +github.com/ekzyis/sn-goapi v0.3.1 h1:Cz/f7/yXMqnZNosRl4TRD3VHfxxkhKsKYCN7SwJc9ck= +github.com/ekzyis/sn-goapi v0.3.1/go.mod h1:FObbYr/NXgnXNWU+EwiWKoWQy+wAaRS6AoW3NgsJ/Oo= github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0= github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= github.com/mattn/go-sqlite3 v1.14.17 h1:mCRHCLDUBXgpKAqIKsaAaAsrAlbkeomtRFKXh2L6YIM= diff --git a/main.go b/main.go index 1f5ae36..e4b10b6 100644 --- a/main.go +++ b/main.go @@ -58,6 +58,7 @@ func main() { log.Println("fetching items ...") r, err := sn.Items(&sn.ItemsQuery{Sort: "recent", Limit: 21}) if err != nil { + log.Println(err) SendToNostr(fmt.Sprint(err)) WaitUntilNext(time.Minute) continue @@ -79,6 +80,7 @@ func main() { comment += "Click [here](https://github.com/zedeus/nitter) for more information._" cId, err := sn.CreateComment(item.Id, comment) if err != nil { + log.Println(err) SendToNostr(fmt.Sprint(err)) continue }