go-mastodon/cmd/mstdn/cmd_followers.go

25 lines
486 B
Go
Raw Normal View History

2017-04-16 15:27:54 +02:00
package main
import (
"fmt"
"github.com/mattn/go-mastodon"
"github.com/urfave/cli"
)
func cmdFollowers(c *cli.Context) error {
client := c.App.Metadata["client"].(*mastodon.Client)
account, err := client.GetAccountCurrentUser()
if err != nil {
return err
}
followers, err := client.GetAccountFollowers(account.ID)
if err != nil {
return err
}
for _, follower := range followers {
2017-04-16 16:04:31 +02:00
fmt.Fprintf(c.App.Writer, "%v,%v\n", follower.ID, follower.Username)
2017-04-16 15:27:54 +02:00
}
return nil
}