Test mastodon

This commit is contained in:
idanoo 2023-01-30 11:59:32 +13:00
parent dcbef8eb1f
commit a54362231b
Signed by: idanoo
GPG key ID: 387387CDBC02F132
2 changed files with 6 additions and 6 deletions

View file

@ -13,8 +13,8 @@ func Run() {
// Write to DB
updatedMetrics := persistMetrics(metrics)
sendToMatrix(updatedMetrics)
postToMastodon(updatedMetrics)
if len(updatedMetrics) > 0 {
// sendToMatrix(updatedMetrics)
postToMastodon(updatedMetrics)
}
}

View file

@ -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 {