mirror of
https://github.com/idanoo/go-mastodon-stats
synced 2025-07-02 22:32:19 +00:00
Test mastodon
This commit is contained in:
parent
dcbef8eb1f
commit
a54362231b
2 changed files with 6 additions and 6 deletions
|
@ -13,8 +13,8 @@ func Run() {
|
||||||
|
|
||||||
// Write to DB
|
// Write to DB
|
||||||
updatedMetrics := persistMetrics(metrics)
|
updatedMetrics := persistMetrics(metrics)
|
||||||
|
if len(updatedMetrics) > 0 {
|
||||||
sendToMatrix(updatedMetrics)
|
// sendToMatrix(updatedMetrics)
|
||||||
|
|
||||||
postToMastodon(updatedMetrics)
|
postToMastodon(updatedMetrics)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,8 +16,8 @@ func postToMastodon(metrics []metric) {
|
||||||
|
|
||||||
c := mastodon.NewClient(&mastodon.Config{
|
c := mastodon.NewClient(&mastodon.Config{
|
||||||
Server: fmt.Sprintf("https://%s", MASTODON_INSTANCE_URL),
|
Server: fmt.Sprintf("https://%s", MASTODON_INSTANCE_URL),
|
||||||
ClientID: "client-id",
|
ClientID: "go-mastodon-stats",
|
||||||
ClientSecret: "client-secret",
|
ClientSecret: "randomgeneratedstringthatimnotsureisneeded",
|
||||||
})
|
})
|
||||||
err := c.Authenticate(context.Background(), MASTODON_USERNAME, MASTODON_PASSWORD)
|
err := c.Authenticate(context.Background(), MASTODON_USERNAME, MASTODON_PASSWORD)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue