argos/optionAnalyzeUserFollowers.go
optionAnalyzeUserFollowers.goRaw
1package main
2
3import (
4 "fmt"
5
6 "github.com/dghubble/go-twitter/twitter"
7)
8
9func optionAnalyzeUserFollowers(client *twitter.Client, username string) {
10 var followers []twitter.User
11 var maxid int64
12 maxid = 0
13 for i := 0; i < 4; i++ {
14 followersRaw, _, err := client.Followers.List(&twitter.FollowerListParams{
15 ScreenName: username,
16 Count: 200,
17 Cursor: maxid,
18 })
19 check(err)
20 maxid = followersRaw.NextCursor
21 for _, f := range followersRaw.Users {
22 /*fmt.Println("@" + follower.ScreenName)
23 fmt.Println("CreatedAt: " + follower.CreatedAt)*/
24 followers = append(followers, f)
25 }
26 fmt.Println(followersRaw.NextCursor)
27 if followersRaw.NextCursor == 0 {
28 break
29 }
30 }
31
32 for k, follower := range followers {
33 fmt.Print(k)
34 fmt.Println(" @" + follower.ScreenName)
35 fmt.Println(" CreatedAt: " + follower.CreatedAt)
36 }
37}