Calculate Reputation like a normal person with Steempy

in #utopian-io6 years ago

So a while back themarkymarky did a really cool article where he showed off something cool called bpython:
https://steemit.com/programming/@themarkymark/python-tips-a-better-interactive-shell
Which you can install in a virtualenv with:

venv) $ pip3 install bpython

Then if you run bpython in the virtualenv you will greated with this really cool color prompt:

venv) $ bpython


Okay so what the heck is this post about? I'm going to be showing you how to calculate reputation in the normal values as displayed in steemit.com's frontend or like shown on steemd.com:

This is the actual reputation value:

So we are going to be using steempy in bpython and then I'm going to try make a function that I found in someone else's code and try call that from a script that uses steempy. Btw there is a really good guide that someone wrote on installing steempy here:
https://steemit.com/steemdev/@throwawayaccount/get-python-steem-library-and-steempy-working-on-linux

Let's get started with steempy in bpython:


As you can see the reputation isn't the normal 25-70 level, this powerlevel is over 9000!


I want to get the reputation to be the normal two digit representation that I'm used to.
I first got some code from a random repo and for some reason, there were some cases where the code didn't work properly. I then did some googling and found out that some other really cool people had already ran into the same issue and created steemit posts about it, this is the one that helped me:
https://steemit.com/utopian-io/@emrebeyler/fixing-reputation-point-calculation-on-steem-python-package-and-steem-rocks

This commit is where the piece of code was that I needed:
https://github.com/emre/steemrocks/commit/86e6f9f4bc4f0fb2c11e1a0bae4f73f4e97bd65c

    @property
    def reputation(self, precision=2):
        rep = int(self.account_data['reputation'])
        if rep == 0:
            return 25
        score = max([math.log10(abs(rep)) - 9, 0]) * 9 + 25
        if rep < 0:
            score = 50 - score
        return round(score, precision)

Pics credit of:

Sort:  

Thank you for your contribution.

  • You didn't follow the template of the tutotials, you can see here.
  • Basic and very short tutorial.

See this example which is a good tutorial.


Need help? Write a ticket on https://support.utopian.io/.
Chat with us on Discord.
[utopian-moderator]

Thanks I didn't know where to find the templates that were mentioned on the video on join.utopian.io and tried googling for them. If I update this post with the template is there I chance that it can be accepted as an utopian submission?

No sorry, try to make a new tutorial with another subject please.
This tutorial is very basic. See the example I gave and make a new one.
I'll be happy to see a new tutorial from you.


Need help? Write a ticket on https://support.utopian.io/.
Chat with us on Discord.
[utopian-moderator]

Cool thanks and will do. Thanks for the feedback and for your time.

Testing something trump4putin

YOLO BOT SEEE this trump4putin

I HAVE SO MUCH BANDZ . trump4putin

trump4putin YEAAAAAAH!

ahahahahah aha a aha a #trump4putin

Loading...

Coin Marketplace

STEEM 0.30
TRX 0.12
JST 0.032
BTC 59241.52
ETH 2989.75
USDT 1.00
SBD 3.71