Examples¶
Print the top rewarded moderators¶
To do this we can use the following code
from utopian_api import Client
c = Client()
moderators = [m for m in c.moderators["results"]]
most_paid = sorted(moderators,
key=lambda x: x["total_paid_rewards"], reverse=True)
for moderator in most_paid[:10]:
print(f"{moderator['account']} {moderator['total_paid_rewards']:.2f}")
which outputs
espoem 370.62
elear 348.30
knowledges 233.45
ruah 217.18
arie.steem 214.00
cnts 39.76
damla 31.35
simnrodrguez 28.56
jefpatat 26.30
flauwy 0.10
Print the most approving moderators in a category¶
To do this we can use the following code
from utopian_api import Client
from collections import Counter
c = Client()
category = "documentation"
posts = c.posts({"status": "approved", "type": category})["results"]
moderators = Counter([post["moderator"] for post in posts])
for m in moderators.most_common(10):
print(f"{m[0]} approved {m[1]} posts in the documentation category.")
with example output:
espoem approved 11 posts in the documentation category.
mcfarhat approved 8 posts in the documentation category.
elear approved 8 posts in the documentation category.
shreyasgune approved 5 posts in the documentation category.
arie.steem approved 4 posts in the documentation category.
ms10398 approved 2 posts in the documentation category.
dutch approved 2 posts in the documentation category.
deveerei approved 2 posts in the documentation category.
knowledges approved 2 posts in the documentation category.
flauwy approved 2 posts in the documentation category.