check if infinite loop

This commit is contained in:
Andriy Cherniy 2024-01-05 21:49:50 +02:00
parent 063083a096
commit 19349e08f7

32
main.go
View file

@ -100,28 +100,28 @@ func main() {
ClientSecret: os.Getenv("MASTODON_CLIENT_SECRET"),
AccessToken: os.Getenv("MASTODON_ACCESS_TOKEN"),
})
masto_user, err := masto_client.GetAccountCurrentUser(ctx)
// masto_user, err := masto_client.GetAccountCurrentUser(ctx)
if err != nil {
log.Fatal(err)
}
var subscribers []*mastodon.Account
var pg mastodon.Pagination
log.Info("test")
log.Debug("get followers list")
for {
fs, err := masto_client.GetAccountFollowers(context.Background(), masto_user.ID, &pg)
if err != nil {
log.Fatal(err)
}
subscribers = append(subscribers, fs...)
log.Debug(pg)
log.Debug(pg.MaxID)
if pg.MaxID == "" {
break
}
}
// var pg mastodon.Pagination
// log.Info("test")
// log.Debug("get followers list")
// for {
// fs, err := masto_client.GetAccountFollowers(context.Background(), masto_user.ID, &pg)
// if err != nil {
// log.Fatal(err)
// }
// subscribers = append(subscribers, fs...)
// log.Debug(pg)
// log.Debug(pg.MaxID)
// if pg.MaxID == "" {
// break
// }
// }
// log.Println(my_account)