Configuration: Windows XP Firefox 2.0.0.6
#!/usr/bin/env python # devloop 2006 import sys, socket, urllib2 if len(sys.argv) < 2: print "Usage: python statsliar.py url <referer_url>" sys.exit(1) url = sys.argv[1] if not url.startswith("http://"): print "Not a valid url" sys.exit(1) if len(sys.argv) == 3: if sys.argv[2].startswith("http://"): referer = sys.argv[2] else: print "Not a valid referer" sys.exit(1) else: referer = "" head = {'User-agent': 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)', 'Referer': 'http://proxy-list.org/downloadproxylist.php?sp=-1&pp=any&pt=any&pc=any&ps=any'} socket.setdefaulttimeout(10) try: req = urllib2.Request("http://proxy-list.org/downloadproxylist.php?sp=-1&pp=any&pt=any&pc=any&ps=any", headers=head) proxylist = urllib2.urlopen(req).readlines() except IOError: print "Error reading proxy list" sys.exit(1) print "Fetching url " + url head = {'User-agent': 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)'} if referer != "": head["Referer"] = referer print "Using referer " + referer for prox in proxylist: prox = prox.strip() try: req = urllib2.Request(url, headers=head) req.set_proxy(prox, 'http') urllib2.urlopen(req) except IOError: continue print prox</referer_url>
;c:\python25