mirror of
https://github.com/idanoo/go-mastodon-stats
synced 2025-07-02 22:32:19 +00:00
Re-enable posting
This commit is contained in:
parent
c2b054158d
commit
f86c26b84f
2 changed files with 10 additions and 11 deletions
|
@ -3,6 +3,7 @@ package gomastodonstats
|
|||
import (
|
||||
"log"
|
||||
"sort"
|
||||
"time"
|
||||
)
|
||||
|
||||
func Run() {
|
||||
|
@ -22,16 +23,16 @@ func Run() {
|
|||
return updatedMetrics[i].MetricValue > updatedMetrics[j].MetricValue
|
||||
})
|
||||
|
||||
// sendToMatrix(updatedMetrics)
|
||||
sendToMatrix(updatedMetrics)
|
||||
|
||||
// Only post weekly here
|
||||
// localTime, err := time.LoadLocation(TIMEZONE)
|
||||
// if err != nil {
|
||||
// log.Fatal(err)
|
||||
// }
|
||||
// weekday := time.Now().Local().In(localTime).Weekday()
|
||||
// if weekday == time.Monday {
|
||||
// postToMastodon(updatedMetrics)
|
||||
// }
|
||||
localTime, err := time.LoadLocation(TIMEZONE)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
weekday := time.Now().Local().In(localTime).Weekday()
|
||||
if weekday == time.Monday {
|
||||
postToMastodon(updatedMetrics)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -173,8 +173,6 @@ func getLastWeekMetric(serviceName string) int {
|
|||
monday,
|
||||
)
|
||||
|
||||
log.Println(val)
|
||||
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
return 0
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue