From 003efe910ec17e6e9c06a3eee6ad9e7a9af7d88a Mon Sep 17 00:00:00 2001 From: idanoo Date: Sun, 12 Feb 2023 14:08:40 +1300 Subject: [PATCH] Only post to Mastodon on Mondays --- internal/gomastodonstats/main.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/internal/gomastodonstats/main.go b/internal/gomastodonstats/main.go index 58e8050..214c3ac 100644 --- a/internal/gomastodonstats/main.go +++ b/internal/gomastodonstats/main.go @@ -3,6 +3,7 @@ package gomastodonstats import ( "log" "sort" + "time" ) func Run() { @@ -23,6 +24,11 @@ func Run() { }) sendToMatrix(updatedMetrics) - postToMastodon(updatedMetrics) + + // Only post weekly here + weekday := time.Now().Weekday() + if weekday == time.Monday { + postToMastodon(updatedMetrics) + } } }