Created
January 8, 2017 17:19
-
-
Save cod3monk/3062aa383320a65fb3adfdfb90e7c7f8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import sys, re, webbrowser, time, random as r | |
from urllib.request import urlopen | |
url = "http://icpc.cs.fau.de/anmeldung.php" | |
def joined_icpc(team): | |
p = urlopen(url).read().decode('u8') | |
return (team in re.findall('D>\n([^<>]+)</T', p)) | |
if __name__ == '__main__': | |
so = sys.stdout | |
so.write("CAN HAZ team name: "); so.flush() | |
team = sys.stdin.readline()[:-1] | |
if not joined_icpc(team): webbrowser.open(url) | |
while not joined_icpc(team): | |
so.write(chr(122-r.randrange(2)*0x20)) | |
so.flush(); time.sleep(1) | |
print("\nKTHXBYE!!1") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment