Fix link, order by most users desc, fix date

This commit is contained in:
idanoo 2023-01-30 12:41:36 +13:00
parent 5a884fe3d9
commit ac25bbc896
Signed by: idanoo
GPG key ID: 387387CDBC02F132
3 changed files with 3 additions and 3 deletions

View file

@ -30,7 +30,7 @@ var (
MATRIX_IDENTIFIDER: "https://mtrx.nz", MATRIX_IDENTIFIDER: "https://mtrx.nz",
MASTODON_IDENTIFIER: "https://mastodon.nz", MASTODON_IDENTIFIER: "https://mastodon.nz",
MOBILIZON_IDENTIFIER: "https://openevents.nz", MOBILIZON_IDENTIFIER: "https://openevents.nz",
PEERTUBE_IDENTIFIER: "https//peertube.nz", PEERTUBE_IDENTIFIER: "https://peertube.nz",
} }
// Pixelfed // Pixelfed

View file

@ -19,7 +19,7 @@ func Run() {
if len(updatedMetrics) > 0 { if len(updatedMetrics) > 0 {
// Sort by counts! // Sort by counts!
sort.Slice(updatedMetrics, func(i, j int) bool { sort.Slice(updatedMetrics, func(i, j int) bool {
return updatedMetrics[i].MetricValue < updatedMetrics[j].MetricValue return updatedMetrics[i].MetricValue > updatedMetrics[j].MetricValue
}) })
sendToMatrix(updatedMetrics) sendToMatrix(updatedMetrics)

View file

@ -27,7 +27,7 @@ func postToMastodon(metrics []metric) {
// Build status // Build status
startOfDay := getStartofDay() startOfDay := getStartofDay()
msg := fmt.Sprintf("Weekly user counts @ %s :laserkiwi:\n\n", startOfDay.String()) msg := fmt.Sprintf("Weekly user counts @ %d-%d-%d :laserkiwi:\n\n", startOfDay.Local().Year(), startOfDay.Local().Month(), startOfDay.Local().Day())
for _, m := range metrics { for _, m := range metrics {
msg = msg + getPrintableString(m) + "\n" msg = msg + getPrintableString(m) + "\n"
} }