From a54362231b29bb5fe3b0f90e23e0fe5e2e997d71 Mon Sep 17 00:00:00 2001 From: idanoo Date: Mon, 30 Jan 2023 11:59:32 +1300 Subject: [PATCH] Test mastodon --- internal/gomastodonstats/main.go | 8 ++++---- internal/gomastodonstats/mastodon.go | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/internal/gomastodonstats/main.go b/internal/gomastodonstats/main.go index 7bfbbec..3490882 100644 --- a/internal/gomastodonstats/main.go +++ b/internal/gomastodonstats/main.go @@ -13,8 +13,8 @@ func Run() { // Write to DB updatedMetrics := persistMetrics(metrics) - - sendToMatrix(updatedMetrics) - - postToMastodon(updatedMetrics) + if len(updatedMetrics) > 0 { + // sendToMatrix(updatedMetrics) + postToMastodon(updatedMetrics) + } } diff --git a/internal/gomastodonstats/mastodon.go b/internal/gomastodonstats/mastodon.go index ceb6874..f021de8 100644 --- a/internal/gomastodonstats/mastodon.go +++ b/internal/gomastodonstats/mastodon.go @@ -16,8 +16,8 @@ func postToMastodon(metrics []metric) { c := mastodon.NewClient(&mastodon.Config{ Server: fmt.Sprintf("https://%s", MASTODON_INSTANCE_URL), - ClientID: "client-id", - ClientSecret: "client-secret", + ClientID: "go-mastodon-stats", + ClientSecret: "randomgeneratedstringthatimnotsureisneeded", }) err := c.Authenticate(context.Background(), MASTODON_USERNAME, MASTODON_PASSWORD) if err != nil {