#!/usr/bin/env python
import urllib2
import urllib

num = 999999 # The number of times to iterate
y = 0 # Error counter

params = {}
params['fields[category]'] = 'Best Act Ever'
params['fields[artist]'] = 'Rick Astley'
params['action[suggestions]'] = 'Vote'
params = urllib.urlencode(params)

for x in range(num):
    print "Running iteration #%s" % (x+1),
    req = urllib2.Request(url='http://ema.mtv.co.uk/vote/#!', data=params)
    try:
        urllib2.urlopen(req)
    except:
		y+=1
        	print ' (error, Success Rate (%s/%s))' % (x+1-y, x+1)
    else:
        print
