STEEM-SockoBot - fix fetching payouts bug

I would like to help @jestemkioskiem in fixing the 'nasty bug' he mentioned here https://utopian.io/utopian-io/@jestemkioskiem/fix-a-nasty-bug-inside-of-a-steem-discord-bot-20-steem-bounty

The bug
I did some tests and it is true that for some users, calculating their pending payouts value was taking very long or never at all.
It takes ages especially for users who:
- has old account
- rarely posts anything
- posts huge articles with many comments inside
I have realized that steem-python library is terribly inefficient. For retrieving someone's posts it traverses through blockchain and downloads huge amount of data from nodes. It is client job to filter that. This is why retrieving old posts takes so long.
Furthermore, it seems like steem-python downloads not only posts metadata but it's body, voters, their vests, blog comments etc. also! That's very huge amount of data.
I decided to switch to another API
Exploring the Internet I realized there aren't many good API nodes. There is one Python API (steem-python I disliked), one Javascript, one PHP... and that's all. Even busy.org and utopian.io uses api.steemit.com! If both these big portals use that, I decided it is the best to use it too.
The only job is to post good query:

I hope retrieving 50 posts is enough for 7 day timeframe. But it's no problem to extend that to 100 or more.
@jestemkioskiem, I did some code refactoring also. I hope the code inside fetch_payouts() is a little bit cleaner now :>
Conclusion
This way calculating pending payouts in USD is done immediately :) It's shame we couldn't fix that using steem-python API.
STEEM developers! For God's sake do smth with that. Now I see why STEEM developing is so slow...
My contribution to Jestemkioskiem/steem-sockobot:
https://github.com/Jestemkioskiem/steem-sockobot/pull/1
Posted on Utopian.io - Rewarding Open Source Contributors
Hey @mys I am @utopian-io. I have just upvoted you!
Achievements
Community-Driven Witness!
I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!
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
Thank you for the contribution. It has been approved.
You can contact us on Discord.
[utopian-moderator]