-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy patharampull.py
31 lines (25 loc) · 977 Bytes
/
arampull.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import json
from secrets import API_KEY
from leagueapi import LolAPI
import datetime
import os
from new_participants import getParticipantData
import pickle as pkl
import time
"""code wont work unless maindir references the stackbattles directory,
and a subdirectory labeled "participant_jsons" is present"""
maindir = "/mnt/c/Users/sydmb/Documents/stackbattles/"
match_path= "{maindir}match_list.pkl" .format(maindir=maindir)
json_path ="{maindir}participants.json" .format(maindir=maindir)
with open(json_path, ) as p_file:
p = json.load(p_file)
for key in p.keys():
for puuid in p[key]:
if puuid in p.keys():
continue
else:
getParticipantData(puuid, maindir+"participant_jsons/",match_path, json_path)
with open(json_path,) as u_file:
u = json.load(u_file)
print("Number of puuids used to pull match data: {c}" .format(c = len(u.keys())))
time.sleep(180)