Skip to content

Instantly share code, notes, and snippets.

@mrphlip
Created September 12, 2014 15:58
Show Gist options
  • Save mrphlip/722ba37a75e902eddac5 to your computer and use it in GitHub Desktop.
Save mrphlip/722ba37a75e902eddac5 to your computer and use it in GitHub Desktop.
Show upgrade script (lrrbot/#50)
#!/usr/bin/env python3
SHOWS = {
'astc': "A Switftly Tilting Cameron",
'gamehaus': "Adam's Gameha\u00FCs",
'backlog': "Beej's Backlog",
'bop': "Book of Passwords",
'ckpt': "CheckPoint Plus",
'crossing': "Crossing the Streams",
'gplp': "GPLP",
'house': "House of Stark",
'iddqderp': "IDDQDerp",
'kstw': "Kathleen Saves the World",
'lrrmtg': "LRRMtG",
'nope': "Let's NOPE",
'things': "Things on My Stream",
'james': "Video Games with Video James",
'watchplay': "Watch and Play",
}
GAMES = {
'249': 'backlog', # Odama
'666': 'bop', # Metal Gear 2: Solid Snake
'776': 'bop', # Metal Slug 2: Super Vehicle - 001/II
'783': 'bop', # Metal Slug
'980': 'bop', # Metal Slug 3
'1420': 'iddqderp', # Half-Life 2
'1468': 'house', # Resident Evil 4
'2748': 'lrrmtg', # Magic: The Gathering
'2770': 'gamehaus', # Tomb Raider
'2851': 'backlog', # Harvest Moon: A Wonderful Life
'3075': 'nope', # Penumbra: Black Plague
'3121': 'things', # E. V. O.: Search for Eden
'3408': 'nope', # Obscure
'4140': 'iddqderp', # Thief: The Dark Project
'4454': 'backlog', # Yoot Tower
'5396': 'bop', # God Hand
'5492': 'bop', # Diablo
'5947': 'bop', # Strider 2
'6155': 'iddqderp', # Painkiller
'6855': 'backlog', # Paper Mario: The Thousand-Year Door
'7421': 'gplp', # OverBlood
'7457': 'bop', # Mega Man 4
'8068': 'nope', # Condemned: Criminal Origins
'9061': 'backlog', # Super Princess Peach
'10775': 'iddqderp', # S.T.A.L.K.E.R.: Shadow of Chernobyl
'11537': 'bop', # Strider
'11644': 'bop', # Castlevania: Rondo of Blood
'13459': 'watchplay', # The Zoo Race
'13725': 'astc', # Master of Orion II: Battle at Antares
'14198': 'backlog', # Metroid Prime
'15141': 'iddqderp', # Half-Life: Opposing Force
'15442': 'kstw', # Shin Megami Tensei: Nocturne
'15752': 'things', # Oni
'15921': 'backlog', # Prince of Persia: Warrior Within
'16037': 'things', # Out of This World
'16676': 'iddqderp', # Team Fortress 2
'17470': 'bop', # Super Mario Kart
'18104': 'bop', # Kirby's Dream Land
'18377': 'bop', # Jet Grind Radio
'18503': 'bop', # Marathon
'18933': 'gamehaus', # Bayonetta
'18957': 'iddqderp', # Just Cause 2
'19170': 'gamehaus', # Darksiders
'19813': 'bop', # Metroid
'21366': 'backlog', # Railfan
'21443': 'iddqderp', # Machinarium
'21474': 'bop', # Strider Returns
'22119': 'nope', # Afterfall: InSanity
'22168': 'kstw', # Shin Megami Tensei: Devil Survivor
'22959': 'iddqderp', # Alice: Madness Returns
'23582': 'iddqderp', # Killing Floor
'23609': 'iddqderp', # S.T.A.L.K.E.R.: Call of Pripyat
'23863': 'astc', # Thief
'24122': 'nope', # Dementium II
'24208': 'gplp', # Metal Gear Rising: Revengeance
'24720': 'backlog', # Railfan: Taiwan High Speed Rail
'25172': 'astc', # World of Warcraft: Cataclysm
'25417': 'gplp', # The Witcher 2: Assassins of Kings
'27126': 'iddqderp', # Bulletstorm
'27340': 'james', # Kingdoms of Amalur: Reckoning
'27471': 'james', # Minecraft
'27626': 'nope', # Silent Hill: Downpour
'28557': 'gplp', # Ryse: Son of Rome
'28641': 'kstw', # Shin Megami Tensei: Devil Survivor Overclocked
'29307': 'gamehaus', # Path of Exile
'29420': 'gamehaus', # Asura's Wrath
'29433': 'iddqderp', # Dark Souls
'31239': 'gamehaus', # Dragon's Dogma
'31567': 'house', # Alan Wake's American Nightmare
'31860': 'iddqderp', # Papo & Yo
'31905': 'house', # New Super Mario Bros. U
'31924': 'gamehaus', # Dragon's Crown
'32156': 'iddqderp', # Dishonored
'32399': 'james', # Counter-Strike: Global Offensive
'32449': 'iddqderp', # Remember Me
'32654': 'gamehaus', # Monster Hunter 3 Ultimate
'32699': 'iddqderp', # Rocketbirds: Hardboiled Chicken
'33175': 'kstw', # South Park: The Stick of Truth
'33437': 'house', # Resident Evil 6
'33790': 'james', # Guacamelee!
'34069': 'things', # Creeper World 3
'34120': 'iddqderp', # Sir, You Are Being Hunted
'34159': 'watchplay', # Revelations 2012
'65867': 'james', # Divinity: Original Sin
'65871': 'nope', # Among The Sleep
'65882': 'crossing', # Tiny and Big: Grandpa's Leftovers
'65950': 'gplp', # Beyond: Two Souls
'65995': 'iddqderp', # Lifeless Planet
'67475': 'kstw', # Lightning Returns: Final Fantasy XIII
'67540': 'iddqderp', # Payday: The Heist 2
'67763': 'james', # Don't Starve
'67834': 'house', # Metal Gear Solid: Ground Zeroes
'73586': 'nope', # Outlast
'75467': 'gplp', # Euro Truck Simulator 2
'79601': 'iddqderp', # Toki
'91423': 'iddqderp', # Dark Souls II
'108936': 'iddqderp', # Teslagrad
'126291': 'gplp', # Killzone: Shadow Fall
'130962': 'backlog', # Densha de Go! Ryojouhen
'130965': 'backlog', # Densha de Go! Final
'134406': 'astc', # Sid Meier's Civilization V: Brave New World
'138566': 'james', # Transistor
'138567': 'kstw', # Final Fantasy X/X-2 HD Remaster
'138573': 'house', # Deus Ex: Human Revolution Director's Cut
'138574': 'iddqderp', # Spin Tires
'138583': 'gplp', # Shovel Knight
'144071': 'nope', # DreadOut
'155489': 'iddqderp', # Far Cry 3: Blood Dragon
'263489': 'iddqderp', # Risk of Rain
'313146': 'nope', # Darkwood
'313256': 'iddqderp', # Broforce
'313517': 'iddqderp', # Child of Light
'313553': 'astc', # XCOM: Enemy Within
'313558': 'james', # Diablo III: Reaper of Souls
'369259': 'iddqderp', # Wolfenstein: The New Order
'369525': 'james', # Titanfall
'369573': 'gplp', # Peggle 2
'369588': 'crossing', # Mario Kart 8
'370352': 'iddqderp', # Crawl
'370375': 'nope', # Doorways
'370421': 'kstw', # Road Not Taken
'370541': 'astc', # Valiant Hearts: The Great War
'415871': 'iddqderp', # Jazzpunk
'416010': 'watchplay', # The Hat Man: Shadow Ward
'417711': 'house', # Viscera Cleanup Detail
'417752': 'ckpt', # Gaming Talk Shows
'417797': 'ckpt', # E3
'417799': 'iddqderp', # Heavy Bullets
'4PM': ('watchplay', '461072', '4PM', None),
'Air Control': ('watchplay', '459567', 'Air Control', None),
'Alpha Zylon': ('watchplay', '461156', 'Alpha Zylon', None),
'Altered Beast': ('crossing', '2332', 'Altered Beast', None),
'Antichamber': ('iddqderp', '29554', 'Antichamber', None),
'Bear Attack': 'iddqderp',
'Bullet Witch': ('astc', '9205', 'Bullet Witch', None),
'Castlevania X': ('bop', '10071', 'Castlevania: Dracula X', None),
'Castlevania: Symphony of the Night': ('bop', '13050', 'Castlevania: Symphony of the Night', None),
'Castlevania: The Dracula X Chronicles': ('bop', '14498', 'Castlevania Chronicles', None),
'Colony Wars': ('bop', '4417', 'Colony Wars', None),
'Dark': ('gplp', '26174', 'Dark', None),
'Dark Souls GALP': ('house', '29433', 'Dark Souls', None),
'Dark Souls II: Gamehaus Edition': ('gamehaus', '91423', 'Dark Souls II', None),
'Dark Souls: Cammander Edition': ('astc', '29433', 'Dark Souls', None),
'Doki Doki Princess Investigator': 'kstw',
'Endless Ocean: Blue World': ('backlog', '21710', 'Endless Ocean: Blue World', None),
'Final Fantasy X-2': ('kstw', '8242', 'Final Fantasy X-2', None),
'Host Master and the Conquest of Humor': ('kstw', '459484', 'Host Master and the Conquest of Humor', None),
"Kirby's Dream Land 2": ('bop', '4089', "Kirby's Dream Land 2", None),
'Magic: The Gathering Conspiracy Draft': 'lrrmtg',
'Mario Kart: Gamehaus Edition': ('gamehaus', '369588', 'Mario Kart 8', None),
'Minecraft: Crossing the Streams': ('crossing', '27471', 'Minecraft', None),
'Minecraft: SkyGrid': 'crossing',
'Minecraft: Super-Hostile': 'crossing',
'New Reckoning': ('watchplay', '460328', 'A New Reckoning', None),
'New Super Mario Bros. U (Crossing the Streams)': ('crossing', '31905', 'New Super Mario Bros. U', None),
'Nintendo Game Pack': 'bop',
'Nuclear Throne': ('iddqderp', '129117', 'Nuclear Throne', None),
'Outlast: Whistleblower': 'nope',
'Prayer Warriors: A.O.F.G.': 'watchplay',
'Rockman 4: Minus Infinity': 'bop',
'Screencheat': ('iddqderp', '417966', 'Screencheat', None),
'Star Wars Rogue Squadron III: Rebel Strike': 'backlog',
'Stolen Jokes Meow Zeroes': 'kstw',
'Strider (2014)': 'bop',
'Strider (Arcade)': 'bop',
'The You Testament': 'watchplay',
'Tumblepop': ('iddqderp', '10680', 'Tumble Pop', None),
'Windows 8.1': 'iddqderp',
'Wolfenstein 3D': ('iddqderp', '7049', 'Wolfenstein 3D', None),
'Goat Sim IDDQDerp': ('iddqderp', '417697', 'Goat Simulator', None),
'Goat Sim HoS': ('house', '417697', 'Goat Simulator', None),
'Goat Sim WatchPlay': ('watchplay', '417697', 'Goat Simulator', None),
}
import json
with open("data.json") as fp:
data = json.load(fp)
# While we're at it, remove some empty/mistake game entries
del data['games']['20023'] # Euro Truck Simulator 1
del data['games']['32954'] # WoW: Mists of Pandaria
del data['games']['A New Reckoning']
del data['games']['Alpha Centauri']
del data['games']['PEPSI Man']
del data['games']['Surgeon Simulator']
# Split up Goat Sim as multiple streams have used the same stats
assert data['games']['417697']['stats'] == {"death": 2, "diamond": 4, "flunge": 1, "pardonfuck": 115, "scream": 2, "tilt": 3} # Make sure there's no new stats since the script was written that need to be handled
votes = data['games']['417697']['votes']
del data['games']['417697']
data['games']['Goat Sim IDDQDerp'] = {'stats': {'diamond': 4, 'pardonfuck': 79, 'tilt': 1}, 'votes': votes}
data['games']['Goat Sim HoS'] = {'stats': {'pardonfuck': 24, 'scream': 1}, 'votes': votes}
data['games']['Goat Sim WatchPlay'] = {'stats': {'pardonfuck': 12, 'flunge': 1}, 'votes': votes}
# Make the migration
data['shows'] = {
'': {
"name": "Unknown",
"games": {},
},
}
for key, name in SHOWS.items():
data['shows'][key] = {
"name": name,
"games": {},
}
for key, vals in data['games'].items():
if isinstance(GAMES[key], str):
show = GAMES[key]
else:
show, key, name, display = GAMES[key]
vals["id"] = key
vals["name"] = name
if display is not None:
vals["display"] = display
elif "display" in vals:
del vals["display"]
data['shows'][show]['games'][key] = vals
del data['games']
with open("data.json", "w") as fp:
json.dump(data, fp, indent=2, sort_keys=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment