Я использую spring-integration-twitter 4.1.6.RELEASE в моем проекте. Используя TwitterTemplate, я пытался получить всех друзей для аутентифицированного пользователя.Друзья и последователи весной Социальные
Так им с помощью этого метода для него,
friendsList = twitterTemplate.friendOperations().getFriends();
Но в данном случае я только получаю 20 друзей в качестве графа по умолчанию. Но у меня есть 33 друга, и я хочу их всех. Как я могу это сделать. Также я являюсь аутентифицированным пользователем, когда я вызываю этот метод. В TwitterTemplate нет способа передать счетчик в качестве параметра. Но API говорит, что он вернет 5000 пользователей.
/** * Retrieves a list of up to 5000 users that the authenticated user follows. * Note that this method make multiple calls to Twitter's REST API (one call to get a list of the friend IDs and one call for every 100 friends). * If all you need is the friend IDs, consider calling getFriendIds() instead. * Or if you need only a subset of the user's friends, call UserOperations.getUsers() passing in the list of friend IDs you need. * @return a list of TwitterProfiles * @throws ApiException if there is an error while communicating with Twitter. * @throws MissingAuthorizationException if TwitterTemplate was not created with OAuth credentials. */ CursoredList<TwitterProfile> getFriends();
TwitterTemplate называет твиттер API для извлечения данных. Поэтому запросите перенаправление на URL-адрес URL-адреса Twitter API https://api.twitter.com/1.1/friends/list.json
.
В это время, результаты упорядочиваются с самыми последними ниже первой - однако, этот порядок подлежит необъявленным изменения и возможных проблем согласованности. Результаты приведены в группах по 20 пользователей, а несколько «страниц» результатов можно перемещать с помощью следующего значения next_cursor в последующих запросах. См. Использование курсоров для навигации по коллекциям для получения дополнительной информации.
Как я могу достичь этого ???