Skip to content

Instantly share code, notes, and snippets.

View charlesreid1's full-sized avatar

Chaz Reid charlesreid1

View GitHub Profile
@lilserf
lilserf / single-game.json
Last active August 26, 2020 02:59
Results for a random single game
[
{
"gameId": "258ed83f-19f3-4ddd-bb7e-9bb85768b8fd",
"eventType": "WALK",
"eventIndex": 0,
"inning": 0,
"outsBeforePlay": 0,
"batterId": "7310c32f-8f32-40f2-b086-54555a2c0e86",
"batterTeamId": "36569151-a2fb-43c1-9df7-2df512424c82",
"pitcherId": "9965eed5-086c-4977-9470-fe410f92d353",
@dlareau
dlareau / gist:26431f6337b44f7ce91cc4bf7d4328cb
Created August 19, 2020 02:43
datablase player, team, and game draft
CREATE TABLE IF NOT EXISTS player(
player_id varchar(36) PRIMARY KEY, /* Use the uuid as the primary key */
captured_at timestamp /* The timestamp when this player data was fetched from the site. */
/* Or better yet if we can get it the timestamp the change took effect */
name text
deceased boolean
/* blaserunning */
base_thirst decimal
continuation decimal
@dlareau
dlareau / graph.py
Last active August 26, 2020 02:33
Plot rescored games
import json
import glob
import requests
from matplotlib import pyplot as plt
from itertools import accumulate
# Load original season 3 games
with open("season3games.json", "r") as f:
line = f.read()
games = json.loads(line)
@dlareau
dlareau / fetchGameData.py
Created August 26, 2020 00:53
fetchGameData
import requests
import json
import sseclient
def getGameDay():
response = requests.get("https://www.blaseball.com/events/streamGameData", stream=True)
client = sseclient.SSEClient(response)
singleEvent = next(client.events())
client.close()