Skip to content

Instantly share code, notes, and snippets.

@wchargin
Created February 15, 2014 21:53
Show Gist options
  • Save wchargin/9025681 to your computer and use it in GitHub Desktop.
Save wchargin/9025681 to your computer and use it in GitHub Desktop.
from urllib import request
import threading
def is_in_page(quiz_id):
try:
url = "http://www.quizegg.com/q/{0}".format(quiz_id)
req = request.urlopen(url)
lines = []
for line in req:
lines.append(line.decode('utf-8'))
return 'APES' in ''.join(lines) # APES = AP Environmental Science
except:
print("maybe ")
return True
class QuizeggTestThread(threading.Thread):
def __init__(self, low, high):
threading.Thread.__init__(self)
self.low = low
self.high = high
def run(self):
for i in range(self.low, self.high):
if is_in_page(i):
print("Found at quiz #{0}".format(i))
for i in range(70000, 80000, 50):
QuizeggTestThread(i, i + 50).start()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment