LOLEX is my first own web site and League of Legends’s game data platform.
LOLEX
Developer K.Geonu
Type of site Game data platform
Written in Flask(Python)
Languages Korean(한국어)
Released 2024-02-15
Main Service
1. Match History & Summoner’s Info
It is the most basic funtion of this site. Using RIOT Api, Showing Summoner’s Info, Match data and Graph, etc..
2. Champion Mastery
It shows the summoner’s champion Mastery list you want
3. Process of Running
3.1 Summoner’s Info
Process
import requests
def get_result(table:dict, targets:list) -> list[dict]:
result = list()
for target in targets:
if target in table:
result.append(table[target])
else:
print(f"{target} not in table")
return result
def get_json(url):
json = requests.get(url)
data = json.json()
return data
def get_data(name, apikey): #riot_id = 최고의피니셔 riot_tag = KR1 lol_name = 최고의피니셔
name = name[:-1]
if '-' in name: #최고의피니셔#kr1
riot_id = name[:name.find('-')]
riot_tag = name[name.find('-')+1:]
id_url = 'https://asia.api.riotgames.com/riot/account/v1/accounts/by-riot-id/{}/{}?api_key={}'.format(riot_id,riot_tag,apikey)
id_data = get_json(id_url)
if len(id_data) == 1:
return "error"
puuid = id_data['puuid']
name_url = 'https://kr.api.riotgames.com/lol/summoner/v4/summoners/by-puuid/{}?api_key={}'.format(puuid,apikey)
summoner_info = get_json(name_url)
lol_name = name
encrypted_id = summoner_info['id']
profile_id = summoner_info['profileIconId']
summoner_level = summoner_info['summonerLevel']
print(puuid)
return puuid, lol_name, riot_id, riot_tag, encrypted_id, profile_id, summoner_level
else: #최고의피니셔
name_url = 'https://kr.api.riotgames.com/lol/summoner/v4/summoners/by-name/{}?api_key={}'.format(name,apikey)
name_data = get_json(name_url)
if len(name_data) == 1:
return "error"
lol_name = name
puuid = name_data['puuid']
encrypted_id = name_data['id']
profile_id = name_data['profileIconId']
summoner_level = name_data['summonerLevel']
id_url = 'https://asia.api.riotgames.com/riot/account/v1/accounts/by-puuid/{}?api_key={}'.format(puuid,apikey)
id_data = get_json(id_url)
riot_id = id_data['gameName']
riot_tag = id_data['tagLine']
summoner_info = name_data
return puuid, lol_name, riot_id, riot_tag, encrypted_id, profile_id, summoner_level
3.2 Match History
Process
def get_match(puuid, lol_version, start_count, end_count, apikey):
global regame_count
global win_count
global loss_count
url = 'https://asia.api.riotgames.com/lol/match/v5/matches/by-puuid/{}/ids?start={}&count={}&api_key={}'.format(puuid, start_count, end_count, apikey)
match_id_data = get_json(url)
match_list = list()
for i in range(len(match_id_data)):
match_list.append('https://asia.api.riotgames.com/lol/match/v5/matches/{}?api_key={}'.format(match_id_data[i], apikey))
match_info = [[0 for k in range(1)] for l in range(len(match_list))]
for i in range(len(match_list)):
match_data = get_json(match_list[i])
match_id = match_id_data[i]
player_info = match_data['info']['participants']
player_metadata = match_data['metadata']['participants']
player_data = player_info[player_metadata.index(puuid)]
player_queue = match_data['info']['queueId']
try:
queue_type = QUEUE_TABLE[player_queue]
except:
queue_type = '특별게임모드'
if queue_type == '아레나':
player_match = get_special_match(player_data, match_id, match_data, player_info, queue_type, lol_version)
match_info[i] = player_match
else:
player_match = get_classic_match(player_data, match_id, match_data, player_info, queue_type, lol_version)
match_info[i] = player_match
return match_info
History
Beta Version
Recent Version