Just save this as karma.py and run it with Python 3.6 or higher.
import requests
import math
INSTANCE_URL = "https://feddit.de"
TARGET_USER = "ENTER_YOUR_USERNAME_HERE"
LIMIT_PER_PAGE = 50
res = requests.get(f"{INSTANCE_URL}/api/v3/user?username={TARGET_USER}&limit={LIMIT_PER_PAGE}").json()
totalPostScore = 0
totalCommentScore = 0
page = 1
while len(res["posts"])+len(res["comments"]) > 0:
totalPostScore += sum([ x["counts"]["score"] for x in res["posts"] ])
totalCommentScore += sum([ x["counts"]["score"] for x in res["comments"] ])
page += 1
res = requests.get(f"{INSTANCE_URL}/api/v3/user?username={TARGET_USER}&limit={LIMIT_PER_PAGE}&page={page}").json()
print("Post karma: ", totalPostScore)
print("Comment karma: ", totalCommentScore)
print("Total karma: ", totalPostScore+totalCommentScore)


Removed by mod
eeeehhhhhhhhhhhhh. the a/an rule is based on the first sound (phone?) of the word, not the spelling. hence “an hour”, for example, where the H is silent, but “a heist” where it’s voiced.
“A user” is correct. You only say “an” when the next word starts with a vowel SOUND, not an actual vowel. Some examples: “an umbrella” vs “a user” ( U vs Y sounds), “a one shot” vs “an onion” (W sound vs U sound)
“A user” is correct. “User” starts with a “y” sound (about which, yes, that’s not definitively a consonant, but it is in this usage), not a “u” sound. Unless there are regionalisms wherein people pronounce it “oozer,” which I’ve not run into, there’s no ambiguity as one sees with “historic.”
A/an decisions rely on pronunciation, not spelling.
https://english.stackexchange.com/questions/105116/is-it-a-user-or-an-user
Removed by mod