|
|
@ -14,21 +14,35 @@ import ( |
|
|
|
|
|
|
|
|
|
|
|
}*/ |
|
|
|
func getUserFollower(client *twitter.Client) string { |
|
|
|
ScreenName := "username" |
|
|
|
return ScreenName |
|
|
|
func getUserToFollowFromUser(client *twitter.Client, fromUser string) string { |
|
|
|
friends, httpResp, err := client.Friends.List(&twitter.FriendListParams{ |
|
|
|
ScreenName: fromUser, |
|
|
|
Count: 1, |
|
|
|
}) |
|
|
|
if err != nil { |
|
|
|
fmt.Println(err) |
|
|
|
} |
|
|
|
if httpResp.Status != "200 OK" { |
|
|
|
c.Red(httpResp.Status) |
|
|
|
} |
|
|
|
//fmt.Println(friends.Users)
|
|
|
|
c.Green(friends.Users[0].ScreenName) |
|
|
|
return friends.Users[0].ScreenName |
|
|
|
} |
|
|
|
|
|
|
|
func followUser(client *twitter.Client, ScreenName string) { |
|
|
|
|
|
|
|
func followUser(client *twitter.Client, screenName string) { |
|
|
|
_, _, _ = client.Friendships.Create(&twitter.FriendshipCreateParams{ |
|
|
|
ScreenName: screenName, |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
func followRandom(client *twitter.Client, nFollow int, ScreenName string) { |
|
|
|
func followRandom(client *twitter.Client, nFollow int, screenName string) { |
|
|
|
fmt.Println("Starting to follow " + strconv.Itoa(nFollow) + " users") |
|
|
|
|
|
|
|
//screenName := firstScreenName
|
|
|
|
for i := 0; i < nFollow; i++ { |
|
|
|
ScreenName = getUserFollower(client) |
|
|
|
followUser(client, ScreenName) |
|
|
|
userToFollow := getUserToFollowFromUser(client, screenName) |
|
|
|
followUser(client, userToFollow) |
|
|
|
screenName = userToFollow |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
@ -50,7 +64,7 @@ func optionFollowRandom(client *twitter.Client) { |
|
|
|
firstScreenName, _ := newcommand.ReadString('\n') |
|
|
|
firstScreenName = strings.TrimSpace(firstScreenName) |
|
|
|
fmt.Print("first user to follow: @") |
|
|
|
c.Purple(answer) |
|
|
|
c.Purple(firstScreenName) |
|
|
|
|
|
|
|
c.Red("Are you sure? [y/n]") |
|
|
|
newcommand = bufio.NewReader(os.Stdin) |
|
|
|