In case someone wanted to see the theoretical code used to get all the badges
they should expand this
Disclamer ugly mashed together code, use at own risk and do not judge me too much on how low quality it is:
from requests_html import HTMLSession
from time import sleep
users=[long list so removed]
badges=['Admired', 'Aficionado', 'Anniversary', 'Appreciated', 'Autobiographer', 'Basic', 'Campaigner', 'Certified', 'Champion', 'Crazy in Love', 'Devotee', 'Editor', 'Empathetic', 'Enthusiast', 'Famous Link', 'First Emoji', 'First Flag', 'First Like', 'First Link', 'First Mention', 'First Onebox', 'First Quote', 'First Reply By Email', 'First Share', 'Gives Back', 'Good Reply', 'Good Share', 'Good Topic', 'Great Reply', 'Great Share', 'Great Topic', 'Higher Love', 'Hot Link', 'Leader', 'Licensed', 'Member', 'New User of the Month', 'Nice Reply', 'Nice Share', 'Nice Topic', 'Out of Love', 'Popular Link', 'Promoter', 'Read Guidelines', 'Reader', 'Regular', 'Respected', 'Thank You', 'Welcome', 'Wiki Editor']
count = 1
for user in users:
print(f'{count}: {user}')
count = count + 1
for i in range(3):
try:
session = HTMLSession()
r = session.get(f'https://forum.dangerousthings.com/u/{user}/badges')
r.html.render(sleep=1, wait=5)
user_badges = r.html.xpath('//div[@class="badge-contents"]//h3//text()')
with open("user_badges.txt", "a") as f:
f.write(f'"{user}": {user_badges},\n')
with open("hidden_badge.txt", "a") as f:
for badge in user_badges:
if badge not in badges:
print(f'FUCKING FOUND ONE: {badge} {user}')
f.write(f'{badge} {user}\n')
break
except Exception as e:
print(f'FUCK... An error... During try {i+1}/3')
sleep(5)