inertia186 / radiator

Hive Ruby API Client
https://hive.blog/hive-139531/@inertia/radiator-v0-4-8-hive-ruby-api-client-eclipse-update
Other
50 stars 22 forks source link

Able to get more then 1000 followers? #16

Closed devopsjourney1 closed 6 years ago

devopsjourney1 commented 6 years ago

Hello. Thank you for the great API! I just have one question. Is there a way to go past 1000 for get_followers? Do I have to split the request up somehow?

api = Radiator::FollowApi.new api.get_followers('inertia', 0, 'blog', 100)

inertia186 commented 6 years ago

Yep, it's a little tricky, but you can "page" past the limit by passing the last follower you have. So if you have not captured any followers, pass nil. If you captured 100, pass the 100th and ask for 100 more. E.g., assume followers is an array of account names, starting with an empty array.

api.get_followers('inertia', followers.last, 'blog', 100)

Then append each result to followers. Here's a detailed explanation:

https://steemit.com/radiator/@inertia/how-to-list-all-followers-in-ruby