Skip to content

Instantly share code, notes, and snippets.

View zephyyrr's full-sized avatar

Johan Fogelström zephyyrr

View GitHub Profile
@zephyyrr
zephyyrr / speedcontrol-speedruncom-donation-fetcher.py
Created November 24, 2016 19:08
Quick python script to fetch current donation totals for ESA Dreamhack Winter Highlights 2016 marathon from speedrun.com
import urllib.request
def main():
url = 'http://www.speedrun.com/ajax_donations.php?marathon=dhw16&action=total'
while (true):
with open('donation_count.txt', 'w') as file:
file.write(clean(get_donations(url)))
def clean(page):
return page.decode("utf-8")