0

I am trying to get 100 newest photos, like

client.tag_recent_media("cat", count: 100)

but it always return around 40 photos (sometimes 36, sometimes 38 and sometimes 40). I am working with this gem.

Is there any wat to fetch 100 photos or 40 is the limit?

Thanks

user984621
  • 46,344
  • 73
  • 224
  • 412

2 Answers2

3

This will do the job:

def search_method

  result = []
  next_id=nil
  while result.length < 100
    data = client.tag_recent_media("cat", max_id: next_id) if a.length == 0
    next_id = data.pagination.next_max_id
    result.concat(data)
  end

end
Yaro
  • 570
  • 3
  • 20
1

You should try something like this

  client.tag_recent_media(1907035, {count: 60})

Unfortunately I think 60 is the maximum amount of photos.

mart1nn
  • 211
  • 3
  • 6