check if infinite loop or go-mastodon is bad
This commit is contained in:
parent
a8a9cf27ba
commit
b3bf6d7b17
1 changed files with 16 additions and 18 deletions
34
main.go
34
main.go
|
@ -100,30 +100,28 @@ func main() {
|
||||||
ClientSecret: os.Getenv("MASTODON_CLIENT_SECRET"),
|
ClientSecret: os.Getenv("MASTODON_CLIENT_SECRET"),
|
||||||
AccessToken: os.Getenv("MASTODON_ACCESS_TOKEN"),
|
AccessToken: os.Getenv("MASTODON_ACCESS_TOKEN"),
|
||||||
})
|
})
|
||||||
_, err = masto_client.GetAccountCurrentUser(ctx)
|
masto_user, err := masto_client.GetAccountCurrentUser(ctx)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
var subscribers []*mastodon.Account
|
var subscribers []*mastodon.Account
|
||||||
// var pg mastodon.Pagination
|
var pg mastodon.Pagination
|
||||||
// log.Info("test")
|
log.Info("test")
|
||||||
// log.Debug("get followers list")
|
log.Debug("get followers list")
|
||||||
// for {
|
for {
|
||||||
// fs, err := masto_client.GetAccountFollowers(context.Background(), masto_user.ID, &pg)
|
fs, err := masto_client.GetAccountFollowers(context.Background(), masto_user.ID, &pg)
|
||||||
// if err != nil {
|
if err != nil {
|
||||||
// log.Fatal(err)
|
log.Fatal(err)
|
||||||
// }
|
}
|
||||||
// subscribers = append(subscribers, fs...)
|
subscribers = append(subscribers, fs...)
|
||||||
// log.Debug(pg)
|
log.Debug(pg)
|
||||||
// log.Debug(pg.MaxID)
|
log.Debug(pg.MaxID)
|
||||||
// if pg.MaxID == "" {
|
if pg.MaxID == "" {
|
||||||
// break
|
break
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
|
|
||||||
// log.Println(my_account)
|
|
||||||
|
|
||||||
matrix_client, err := mautrix.NewClient(os.Getenv("MATRIX_HOMESERVER"), m_id.UserID(os.Getenv("MATRIX_USERNAME")), os.Getenv("MATRIX_ACCESS_TOKEN"))
|
matrix_client, err := mautrix.NewClient(os.Getenv("MATRIX_HOMESERVER"), m_id.UserID(os.Getenv("MATRIX_USERNAME")), os.Getenv("MATRIX_ACCESS_TOKEN"))
|
||||||
matrix_client.Store = mautrix.NewAccountDataStore("ua.in.fediland.uabot", matrix_client)
|
matrix_client.Store = mautrix.NewAccountDataStore("ua.in.fediland.uabot", matrix_client)
|
||||||
|
|
Loading…
Reference in a new issue