SwiftInstagram icon indicating copy to clipboard operation
SwiftInstagram copied to clipboard

Getting all media from signed in user

Open onurgenes opened this issue 6 years ago • 8 comments

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!

onurgenes avatar Dec 11 '17 19:12 onurgenes

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.

AnderGoig avatar Dec 12 '17 11:12 AnderGoig

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!

onurgenes avatar Dec 12 '17 16:12 onurgenes

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.

AnderGoig avatar Dec 12 '17 18:12 AnderGoig

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

onurgenes avatar Dec 12 '17 20:12 onurgenes

Thanks @onurgenes, I hope they accept it!

AnderGoig avatar Dec 12 '17 20:12 AnderGoig

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

onurgenes avatar Dec 12 '17 20:12 onurgenes

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.

alexandre-g avatar May 25 '18 07:05 alexandre-g

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

AnderGoig avatar Jul 22 '18 21:07 AnderGoig