Skip to content

Commit

Permalink
Merge pull request #4 from rithikasilva/development
Browse files Browse the repository at this point in the history
Change mastery endpoint and fix seasonal game mode issue
  • Loading branch information
rithikasilva authored Oct 31, 2023
2 parents 731e417 + 51d7553 commit c397d0e
Show file tree
Hide file tree
Showing 26 changed files with 19 additions and 23 deletions.
16 changes: 6 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,7 @@ There must be a folder titled `readme-lol-items` in the repository that you wish
"Target File": "README.md",
"Toggle Credit": 1,
"Skin Substitutions": {
"Yasuo": "Nightbringer Yasuo",
"Yone": "Dawnbringer Yone",
"Akali": "K/DA Akali",
"Taliyah": "Pool Party Taliyah",
"Katarina": "Battle Queen Katarina"
"Caitlyn": "Battle Academia Caitlyn"
},
"Extra Info": {
"Seconds of CC": 1,
Expand Down Expand Up @@ -103,11 +99,11 @@ Here is an example layout (best viewed with proper formatting [here](https://git
<h3 align='center'> Data from Last 10 Matches for Doublelift</h3><table align='center'><tr></tr>
<tr align='left'><th><pre>Top 5 Recently Played Champions
-------------------------
<img src='readme-lol-items/loading_Zeri.gif' alt='drawing' width='400'/>
<img src='readme-lol-items/loading_Lucian.gif' alt='drawing' width='400'/>
<img src='readme-lol-items/loading_Twitch.gif' alt='drawing' width='400'/>
<img src='readme-lol-items/loading_Varus.gif' alt='drawing' width='400'/>
<img src='readme-lol-items/loading_Jhin.gif' alt='drawing' width='400'/>
<img src='readme-lol-items/loading_Xayah.gif' alt='drawing' width='400'/>
<img src='readme-lol-items/loading_Kindred.gif' alt='drawing' width='400'/>
<img src='readme-lol-items/loading_Briar.gif' alt='drawing' width='400'/>
<img src='readme-lol-items/loading_KogMaw.gif' alt='drawing' width='400'/>
<img src='readme-lol-items/loading_Kaisa.gif' alt='drawing' width='400'/>
-------------------------
<img align='center' src='readme-lol-items/extra_info.gif' alt='drawing' width='350'/></pre></th><th><pre>Top 3 Champion Masteries
------------------------
Expand Down
16 changes: 10 additions & 6 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,11 +278,15 @@ def get_main_section_data(puuid, api_key, extra_data, list_of_matches):
for participant in response["info"]["participants"]:
if participant["puuid"] == puuid:
last_champs_played.append(participant["championName"])
ability_usage += participant["challenges"]["abilityUses"]


played_positions.append(participant["individualPosition"])
time_ccing += participant["timeCCingOthers"]
solo_kills += participant["challenges"]["soloKills"]
take_downs += participant["challenges"]["takedowns"]

if "challenges" in participant:
ability_usage += participant["challenges"]["abilityUses"]
solo_kills += participant["challenges"]["soloKills"]
take_downs += participant["challenges"]["takedowns"]

global_kills += participant["kills"]
global_deaths += participant["deaths"]
Expand Down Expand Up @@ -339,9 +343,9 @@ def get_main_section_data(puuid, api_key, extra_data, list_of_matches):
Returns:
- a dictionary which contains a list of lists. The lowests lists contain each champions name, their loading image title, and their mastery score.
'''
def get_mastery_section_data(id, api_key):
def get_mastery_section_data(puuid, api_key):
# Get mastery information
champ_id_points = rf.get_masteries(id, api_key)
champ_id_points = rf.get_masteries(puuid, api_key)
champ_data = dd.get_champion_data()

for id in champ_id_points:
Expand Down Expand Up @@ -407,7 +411,7 @@ def main():
# Returns the extra_data and a reverse list of the recently played champions
main_widget_info = get_main_section_data(puuid, key, extra_data, matches)
# Get Mastery Info
mastery_widget_info = get_mastery_section_data(id, key)
mastery_widget_info = get_mastery_section_data(puuid, key)


# Gather the square and loading images
Expand Down
Binary file added readme-lol-items/Briar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed readme-lol-items/Jhin.png
Binary file not shown.
Binary file added readme-lol-items/Kaisa.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added readme-lol-items/Kindred.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added readme-lol-items/KogMaw.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed readme-lol-items/Lucian.png
Binary file not shown.
Binary file removed readme-lol-items/Twitch.png
Binary file not shown.
Binary file removed readme-lol-items/Varus.png
Binary file not shown.
Binary file added readme-lol-items/Xayah.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed readme-lol-items/Zeri.png
Binary file not shown.
6 changes: 1 addition & 5 deletions readme-lol-items/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@
"Target File": "README.md",
"Toggle Credit": 1,
"Skin Substitutions": {
"Yasuo": "Nightbringer Yasuo",
"Yone": "Dawnbringer Yone",
"Akali": "K/DA Akali",
"Taliyah": "Pool Party Taliyah",
"Katarina": "Battle Queen Katarina"
"Caitlyn": "Battle Academia Caitlyn"
},
"Extra Info": {
"Seconds of CC": 1,
Expand Down
Binary file modified readme-lol-items/extra_info.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added readme-lol-items/loading_Briar.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed readme-lol-items/loading_Jhin.gif
Binary file not shown.
Binary file added readme-lol-items/loading_Kaisa.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added readme-lol-items/loading_Kindred.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added readme-lol-items/loading_KogMaw.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed readme-lol-items/loading_Lucian.gif
Binary file not shown.
Binary file removed readme-lol-items/loading_Twitch.gif
Binary file not shown.
Binary file removed readme-lol-items/loading_Varus.gif
Binary file not shown.
Binary file added readme-lol-items/loading_Xayah.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed readme-lol-items/loading_Zeri.gif
Binary file not shown.
Binary file modified readme-lol-items/mastery.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions riot_api_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ def get_summoner_rank(id, api_key):
Returns:
- parsed -- list of dictionaries containing the id of a champion and the requested summoners mastery of them.
'''
def get_masteries(id, api_key):
mastery_data = riot_api_get("na1", f"lol/champion-mastery/v4/champion-masteries/by-summoner/{id}/top", {"api_key": api_key})
def get_masteries(puuid, api_key):
mastery_data = riot_api_get("na1", f"lol/champion-mastery/v4/champion-masteries/by-puuid/{puuid}", {"api_key": api_key})
parsed = []
for champ in mastery_data:
parsed.append({"championId": champ["championId"], "championPoints": champ["championPoints"]})
Expand Down

0 comments on commit c397d0e

Please sign in to comment.