Python Challenge [4]

Our first chance to play with urllib!

I’ll expand the commentary and clean this up in a bit, for the moment, suffice it to say that this is pretty h4xx0r3d and requires you to actually check the output as is goes along.


import urllib
nada = 12345
nada = 92118/2
c = 1
while(c<=201):
	url = "http://www.pythonchallenge.com/pc/def/linkedlist.php?nothing=%s" % (nada)
	raw = urllib.urlopen(url).read()
	print raw
	nada = raw[-5:]
	if(nada[1:2].isspace()==1):
		nada = raw[-3:]
	elif(nada[0:1].isspace()==1):
		nada = raw[-4:]
	print nada
	c += 1