Ejemplo n.º 1
0
// Get followers' user IDs
func getFollowersIDs(followerCount string, api *anaconda.TwitterApi) map[int64]bool {
	params := url.Values{}
	params.Set("count", followerCount)

	// Get the list of IDs from the API
	followerIdsAll, err := api.GetFollowersIds(params)
	if err != nil {
		log.Fatalf("Failed to get followers data: %s", err)
	}
	followerIdsTemp := followerIdsAll.Ids

	// Create a map
	followerIds := make(map[int64]bool)
	for _, followerId := range followerIdsTemp {
		followerIds[followerId] = true
	}

	return (followerIds)
}