Fixing instabot projects' get_media_comments/commenters functionality

in #utopian-io7 years ago (edited)

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

Sort:  

Thank you for the contribution. It has been approved.

You can contact us on Discord.
[utopian-moderator]

Ne işe yarıyor hocam bir de hangi dil ile yazdınız ?

Hey @emrebeyler I am @utopian-io. I have just upvoted you at 4% Power!

Achievements

  • You have less than 500 followers. Just gave you a gift to help you succeed!
  • Seems like you contribute quite often. AMAZING!

Suggestions

  • Contribute more often to get higher and higher rewards. I want to see you often!
  • Work on your followers to increase the votes/rewards. My vote is now primarily based on that, humans rule. Good luck!
  • Wondering why other contributions got more? I introduced a competition factor. My vote is also based on how competitive the category used is.

Community-Driven Witness!

I am the first and only Steem Community-Driven Witness. Vote for my Witness. Lets GROW TOGETHER!

Screen Shot 2017-11-19 at 16.54.19.png

Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x

This post was promoted with @monitorcap traffic bot & STEEM promotion service.

Send MIN. $1 SBD to @monitorcap bot with your link in MEMO field
and recieve upvotes & resteems for your posts. @monitorcap - where 'seen' matters !

Coin Marketplace

STEEM 0.16
TRX 0.25
JST 0.034
BTC 94126.54
ETH 2654.67
USDT 1.00
SBD 0.69