0

I am using Instasharp and I need to get paginated sets of images tagged with "Car":

  String clientId = "xyz";
  String clientSecret = "xyz";
  var config = new InstagramConfig(clientId, clientSecret);

  var query = new InstaSharp.Endpoints.Tags(config);

  var reply1 = query.Recent("Car", null, null, 2);

  var reply2 = query.RecentMultiplePages("Car", null, null, 20, null);

When I check reply2 I see that 600 items were loaded and PageCount is equal to 20.

And I also get a PaginationNextMaxId ..

The point is that I do want to load all items.

I need to load only 20 and to have enough information to load the next 20.

Does anyone knows how can I do this?

UPDATE

I tried the following:

var reply1NextPage = query.Recent("Car", reply1.Result.Pagination.NextMinId, reply1.Result.Pagination.NextMaxId, 2);

But the result it null ...

Miguel Moura
  • 36,732
  • 85
  • 259
  • 481

1 Answers1

0

Here's the Python solution: are you checking for null results and cycling through?

    if dataObj.get('pagination') is not None:
        next_url = dataObj.get('pagination').get('next_url')

Here's how you get non-null results from paginating in Instagram.