Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import requests
- def findbums():
- league = "Havoc+Challenge+League+(PL4362)"
- realm = "pc"
- id = "1556123991345"
- url = "https://www.pathofexile.com/api/ladders"
- offset = 0
- limit = 200
- accounts = {}
- for i in range(0, 43):
- r = requests.get("{0}?offset={1}&limit={2}&id={3}&type=league&realm={4}&_={5}"
- .format(url, offset, limit, league, realm, id))
- offset += limit
- json = r.json()
- for j in range(0, limit):
- entry = json["entries"][j]
- name = entry["account"]["name"]
- alive = entry["dead"]
- level = entry["character"]["level"]
- if name in accounts:
- if alive:
- accounts[name]["alive"].append(level)
- else:
- accounts[name]["dead"].append(level)
- else:
- accounts[name] = {
- "alive": [level] if alive else [],
- "dead": [] if alive else [level]
- }
- bums = []
- for account, data in accounts.items():
- if len(data["alive"]) == 0 and max(data["dead"]) < 30:
- bums.append(account)
- print(bums)
- print(len(bums))
- if __name__ == '__main__':
- findbums()
- Result:
- ['arcolas', 'LoA89', 'dooshbagginss', 'PathOfReeep', 'FlyingZamboni', 'Bumbuys', 'Headpipe', 'steve2355', 'Flowing', 'Darkisss', 'OrangeGu', 'Seraaz', 'quasicat', 'guingo1', 'improvizatoric', 'Auditorium', 'KennyWuLee', 'AreYouLOX', 'MaddyDaddy', 'Evandrinde', 'dstfgh', 'LittleSallybow', 'SisterHell', 'ywt978', 'poolie147', 'decro024', 'Riznell123', 'gleb94gleb', 'Raydient', 'Timmiejj1', 'Lukazarra1', 'escylap']
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement