Quantcast
Channel: Tweetinvi a friendly Twitter C# library
Viewing all articles
Browse latest Browse all 4126

New Post: How to get all the followers

$
0
0
Hi,

Tweetinvi has been developed so you don't ever need to do a query for implemented features. Though if you really want to perform a CursoredQuery for Follower Ids here is the code you need.
TwitterCredentials.SetCredentials("CREDENTIAL", "CREDENTIAL", "CREDENTIAL", "CREDENTIAL");
var userId = 14230524;
var followerQuery = String.Format("https://api.twitter.com/1.1/followers/ids.json?user_id={0}", userId);
int maxObjectsToRetrieve = 7500;
var returnedIds = TwitterAccessor.ExecuteCursorGETQuery<IIdsCursorQueryResultDTO>(followerQuery, maxObjectsToRetrieve).SelectMany(x => x.Ids);

// You will now have 10000 Follower Ids and not 7500 because this is returning result of the query itself (2 results of 5000 each)// You can now limit the size by just taking the first 7500 ones.var followerIds = returnedIds.Take(maxObjectsToRetrieve);
Regards,
Linvi

Viewing all articles
Browse latest Browse all 4126

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>