AnderGoig / SwiftInstagram

Instagram API client written in Swift
https://git.io/vdNAn
MIT License
580 stars 79 forks source link

Getting all media from signed in user #18

Open onurgenes opened 6 years ago

onurgenes commented 6 years ago

Checklist

How can I get the all media from user? I can get recent 20 media but, I want to get all of them and then will choose lowest liked medias.

Thanks in advance!

AnderGoig commented 6 years ago

Hi @onurgenes, you can get more media by specifying how much you want with the count parameter, something like this:

api.recentMedia(fromUser: <YOUR USER>,
                count: <HOW MUCH MEDIA YOU WANT>,
                success: ...,
                failure: ...)

Even so, I think the maximum media returned per request is 33, if you specify more than that the Instagram API replies with pagination results, which is something I'm still working on to support.

onurgenes commented 6 years ago

Hello there @AnderGoig,

I think I need pagination support. I need to take all photos and choose the photos which is shared in 2017. So I am eagerly waiting you to support that feature!

Thanks!

AnderGoig commented 6 years ago

I've been working on this and I have created a new branch called pagination to test this feature.

The problem is that this feature is limited to non-sandbox Instagram clients, so I can't test it with mine :confused:

Is your Instagram client out of sandbox mode? Because that will be perfect to test it.

onurgenes commented 6 years ago

I will send my Client for a submission. Let's if it's going to work.

AnderGoig commented 6 years ago

Thanks @onurgenes, I hope they accept it!

onurgenes commented 6 years ago

But first, I need to finish the app. If they accepts, I can share the client info with you. Thanks for hard work!

alexandre-g commented 6 years ago

Seems like a great library, but you call looping through all the images pagination? :) You realize many people have 2000+ photos on their accounts? Perhaps can expose the Pagination object for clients to handle pagination themselves? Since requests accept maxId parameter already, and requirements for preloading can differ quite a bit from user to user.

AnderGoig commented 6 years ago

You're right. I'm removing this branch for now.