Rick Astley
Oct. 2nd, 2008 05:44 pmOK, so I presume you all know what a Rick Roll is?
Please see this Wikipedia link: http://en.wikipedia.org/wiki/Rickrolling if you don't.
Well, it seems that we have the MTV music awards up 'soon'.
And wouldn't you know? Rick's up, for 'Best Act Ever'. http://news.bbc.co.uk/1/hi/entertainment/7646807.stm
It seems that MTV are good at this voting thing. They have their website: http://ema.mtv.co.uk/vote
And it even says... 'please vote again, to make sure your favourite wins'.
4chan noticed.
So now there's a little bit of Python doing the rounds, which submits votes to MTV.
It seems somehow a cutting irony that he's doing so well, with a 20 year old song, based ... pretty much on how funny 4chan thinks it is.
I'm quite impressed at how simple a language it is, to do that. You may need to download a python interpreter to run it, mind. Which you can get from: http://www.python.org/download/
I've installed a copy, purely for academic curiousity you under stand. But really, what better reason to learn Python?
Please see this Wikipedia link: http://en.wikipedia.org/wiki/Rickrolling if you don't.
Well, it seems that we have the MTV music awards up 'soon'.
And wouldn't you know? Rick's up, for 'Best Act Ever'. http://news.bbc.co.uk/1/hi/entertainment/7646807.stm
It seems that MTV are good at this voting thing. They have their website: http://ema.mtv.co.uk/vote
And it even says... 'please vote again, to make sure your favourite wins'.
4chan noticed.
So now there's a little bit of Python doing the rounds, which submits votes to MTV.
It seems somehow a cutting irony that he's doing so well, with a 20 year old song, based ... pretty much on how funny 4chan thinks it is.
#!/usr/bin/env python
import urllib2
import urllib
import time
num = 1000000 # The number of times to iterate
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):
try:
print "Running iteration #%s" % x
time.sleep(1)
req = urllib2.Request(url='http://ema.mtv.co.uk/vote/', data=params)
urllib2.urlopen(req)
except:
print "MTV server seems stressed. BUT THE SPAM MUST GO ON"
I'm quite impressed at how simple a language it is, to do that. You may need to download a python interpreter to run it, mind. Which you can get from: http://www.python.org/download/
I've installed a copy, purely for academic curiousity you under stand. But really, what better reason to learn Python?
no subject
Date: 2008-10-02 09:16 pm (UTC)no subject
Date: 2008-10-04 12:18 am (UTC)That's a good example my most hated thing to never, ever, ever to do in python. (An instant banned from computers offense.) I've already lost days of my life to people doing that. That unqualified except block will catch any type of error (syntax errors, missing modules, typos, bad function arguments) and convert them into a message that probably lies about what the problem is.