Пример #1
0
//getFriends uses the Twitter API to get people you follow, which it dubs "friends". Don't blame me for twitter's sense of self-importance.
func getFriends(api *anaconda.TwitterApi, result chan anaconda.UserCursor, v url.Values) {
	v.Set("count", "200")
	v.Set("skip_status", "true")
	v.Set("include_user_entities", "false")

	cursor, err := api.GetFriendsList(v)
	if err != nil {
		logger.Panic("Error getting friends from twitter", err)
	}
	result <- cursor

	if cursor.Next_cursor == 0 {
		close(result)
		return
	}

	logger.Println("Fetching next set of friends, starting with cursor ", cursor.Next_cursor_str)
	v.Set("cursor", cursor.Next_cursor_str)
	getFriends(api, result, v)
}