Hey I missing a .dll?

Nov 25, 2014 at 1:48 PM
I trying test out some queries example , but I can't do without this namespace

Tweetinvi.Core.Interfaces.DTO.QueryDTO

Example:
 var credentials = TwitterCredentials.CreateCredentials(access_Token, access_Token_Secret, consumer_Key, consumer_Secret);
           
             TwitterCredentials.ExecuteOperationWithCredentials(credentials, () =>
        {
            var followerQuery = String.Format("https://api.twitter.com/1.1/followers/ids.json?user_id={0}", 111111111);
            var returnedIds = TwitterAccessor.ExecuteCursorGETQuery<IIdsCursorQueryResultDTO>(followerQuery, 220000)
                .SelectMany(x => x.Ids);  }
         }
Error 2 The type or namespace name 'QueryDTO' does not exist in the namespace 'Tweetinvi.Core.Interfaces.DTO' (are you missing an assembly reference?)

Error 3 The type or namespace name 'IIdsCursorQueryResultDTO' could not be found (are you missing a using directive or an assembly reference?)
Coordinator
Nov 25, 2014 at 5:14 PM
This namespace is available when you reference the Tweetinvi.Core dll.
In theory you must have this dll referenced to use Tweetinvi as all the other dll references it.

Have you taken the dll's from nuget?

By the way I can see that you are trying to get 220000 followers, please note that you will check your rate limits to get this number of followers.

Regards,
Linvi
Nov 25, 2014 at 6:13 PM
ohh, okay thanks, but how can you get all 220000
Coordinator
Nov 26, 2014 at 1:07 PM
You will have to use the RateLimit and check that you have enough rate to access the information.
var followerRateLimits = RateLimit.GetCurrentCredentialsRateLimits().FollowersIdsLimit;
if (followerRateLimits.Remaining > 0)
{
    // Call method
}
else
{
    // Wait for refreshed rate limit
    Thread.Sleep((int)followerRateLimits.ResetDateTimeInMilliseconds);
}
Linvi
Nov 26, 2014 at 1:52 PM
I did some research and found about using cursor_id in the url, but how can I get the return cursor_id for getting all followers? I know there there an api limit, but i was wondering how can I get the cursor_id and return to where I was at so I can continue getting followers from where I left.
Coordinator
Nov 26, 2014 at 6:00 PM
Hi,

Please use the following code :
var results = TwitterAccessor.ExecuteCursorGETCursorQueryResult<IIdsCursorQueryResultDTO>(query, maxNumberOfResults);
var lastCursor = results.Last().NextCursor;
Linvi
Nov 26, 2014 at 7:27 PM
This works fine, but when I add the cursor_id output to the command, I get an error because it a ulong instead of a long.

var maxObjectsToRetrieve= 200;
var lastCursor = -1

  var followerQuery = String.Format("https://api.twitter.com/1.1/followers/ids.json?user_id={0}&count=100&cursor={1}", userId, cur);
              

var results = TwitterAccessor.ExecuteCursorGETQuery<IIdsCursorQueryResultDTO>(followerQuery, maxObjectsToRetrieve, lastCursor);
 lastCursor = results.Last().NextCursor;

  var returnedIds = TwitterAccessor.ExecuteCursorGETQuery<IIdsCursorQueryResultDTO>(followerQuery,maxObjectsToRetrieve,  lastCursor).SelectMany(x => x.Ids);
I not sure how to go around this; my cursor idea look like this:

my_cursor_id=14858654389000846794
Coordinator
Nov 26, 2014 at 7:46 PM
Edited Nov 26, 2014 at 7:46 PM
Hi,

Don't specify the cursor yourself, let Tweetinvi manage it for you.
I have changed the query so that the count and cursor information are no longer added to the query. Tweetinvi will add these information for you.
var maxObjectsToRetrieve= 200;
long lastCursor = -1;
var followerQuery = String.Format("https://api.twitter.com/1.1/followers/ids.json?user_id={0}", userId);


var results = TwitterAccessor.ExecuteCursorGETCursorQueryResult<IIdsCursorQueryResultDTO>(followerQuery, maxObjectsToRetrieve, lastCursor);
lastCursor = results.Last().NextCursor;

var returnedIds = TwitterAccessor.ExecuteCursorGETCursorQueryResult<IIdsCursorQueryResultDTO>(followerQuery, maxObjectsToRetrieve, lastCursor).SelectMany(x => x.Ids);
Linvi
Marked as answer by linvi on 12/2/2014 at 12:02 PM
Nov 28, 2014 at 12:44 PM
Sorry for the late response. By the way it works. Thank you !