2018-01-29 05:15:06 +01:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"fmt"
|
|
|
|
|
|
|
|
"github.com/mattn/go-mastodon"
|
|
|
|
"github.com/urfave/cli"
|
|
|
|
)
|
|
|
|
|
|
|
|
func cmdInstanceActivity(c *cli.Context) error {
|
|
|
|
client := c.App.Metadata["client"].(*mastodon.Client)
|
|
|
|
activities, err := client.GetInstanceActivity(context.Background())
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
for _, activity := range activities {
|
|
|
|
fmt.Fprintf(c.App.Writer, "Logins : %v\n", activity.Logins)
|
|
|
|
fmt.Fprintf(c.App.Writer, "Registrations : %v\n", activity.Registrations)
|
|
|
|
fmt.Fprintf(c.App.Writer, "Statuses : %v\n", activity.Statuses)
|
2018-01-29 05:16:31 +01:00
|
|
|
fmt.Fprintf(c.App.Writer, "Week : %v\n", activity.Week)
|
2018-01-29 05:15:06 +01:00
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|