Skip to content

Instantly share code, notes, and snippets.

@bangingheads
bangingheads / unlock_skin_shard.py
Created October 17, 2023 22:04
Show skin shards for champion's without a skin
from pprint import pprint
from lcu_driver import Connector
import requests
import easygui
connector = Connector()
@connector.ready
async def connect(connection):
version = requests.get("https://ddragon.leagueoflegends.com/api/versions.json").json()[0]
@bangingheads
bangingheads / example.js
Last active April 14, 2022 13:47
Using Cloudflare Workers to Make Requests to Riot Games API
/*
Cloudflare Workers Script to make request to the Riot Games API
By: BangingHeads
Supports GET Requests
Supports Path and GET Parameters as GET Parameters
Example path: https://example.bangingheads.workers.dev/api/?region=na1&endpoint=/lol/summoner/v4/summoners/by-name/{summonerName}&summonerName=Headbang
Use Guide on Hextech Docs (https://hextechdocs.dev) if you need more help
*/
@bangingheads
bangingheads / cdragonrates.py
Created November 22, 2021 15:25
Script to grab champion play rates from cdragon in meraki format
import json
import re
import requests
all_champs = {}
data = requests.get("https://raw.communitydragon.org/latest/plugins/rcp-fe-lol-champion-statistics/global/default/rcp-fe-lol-champion-statistics.js")
matches = re.findall('.exports=({.*)},', data.text)
if len(matches) > 0:
match = matches[0]
match = re.sub("([A-Z0-9]*):", r'"\1":', match)
{
"matchInfo": {
"matchId": "2661e9c6-10a7-48da-821a-1eb480afc77e",
"mapId": "/Game/Maps/Port/Port",
"gameLengthMillis": 470249,
"gameStartMillis": 1630452346572,
"provisioningFlowId": "Matchmaking",
"isCompleted": true,
"customGameName": "",
"queueId": "spikerush",