We're running a travel blog and Instagram page about it with my wife. A couple of days ago, we have organized a contest for a small thing we buy in one of our travels.
We have got a lot of participants. When the day of draw came, my wife asked me to get the follower/participant list automatically since there were a lot of them.
I am already using instabot to get some automated stuff like following back, liking the timeline etc, for our Instagram account.
After doing some digging with instapy, I saw that I had everything I need.
- I could get media likes
- I could get media comments
- I could get my follower list
In order to be an eligible participant, you should be able to inside these 3 sets of data.
But there was a problem. instabot's getMediaComments just sending one initial request to get the media. If you have a media with 20+ comments, you can see only 20.
the fix
I have made a quick fix with a recursive approach until fetching all comments. And ran my contest code - which ran perfectly fine.
Changeset for the bugfix touches 2 projects in the instagrambot organization.
Pull Request 1: https://github.com/instagrambot/instabot/pull/400
Pull Request 2: https://github.com/instagrambot/api/pull/5
Posted on Utopian.io - Rewarding Open Source Contributors