add instance_activity/instance_peers command

This commit is contained in:
Yasuhiro Matsumoto 2018-01-29 13:15:06 +09:00 committed by mattn
parent 84ffd85539
commit 0022a53649
3 changed files with 55 additions and 0 deletions

View file

@ -0,0 +1,21 @@
package main
import (
"context"
"fmt"
"github.com/mattn/go-mastodon"
"github.com/urfave/cli"
)
func cmdInstancePeers(c *cli.Context) error {
client := c.App.Metadata["client"].(*mastodon.Client)
peers, err := client.GetInstancePeers(context.Background())
if err != nil {
return err
}
for _, peer := range peers {
fmt.Fprintln(c.App.Writer, peer)
}
return nil
}