Title: [Python] import httplib from Queue import Queue from threading import Thread import ti Author: Anonymous Pastebin link: http://pastebin.com/Hy6WkLgR First Edit: Friday 7th of December 2012 06:22:10 PM CDT Last Edit: Friday 7th of December 2012 06:22:10 PM CDT import httplib from Queue import Queue from threading import Thread import time   HEADERS = {"Host": "www.tv.com",            "Connection": "keep-alive",            "Origin": "http://www.tv.com",            "X-Requested-With": "XMLHttpRequest",            "User-Agent": "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.8 (KHTML, like Gecko) Chrome/23.0.1250.0 Safari/537.8",            "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",            "Accept": "*/*",            "Referer": "http://www.tv.com/features/best-of-2012/vote/poll/SpecialFeatures:list:best-animated-series/",            "Accept-Encoding": "gzip,deflate,sdch",            "Accept-Language": "en-US,en;q=0.8",            "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.3",            "Cookie": "LDCLGFbrowser=41a5cfcb-fe54-4871-be3a-3f37b6029814; MAD_SESSION=b; MADTEST=1; XCLGFbrowser=Cg5iVlDBJ9a3AAAAq0E; MAD_INTERNAL=0; ab_test=C; bwp2=8e4a0d207d936255b303e2153c931cfd,21.7216284087957,v1; MAD_FIRSTPAGE=0; tv_interstitial=2; rsi_segs=; gac_2_eLY43wKDh8zIjYVcLg06nWA4yxeG6QV8gCEeYa85r8swMKFewENJUHK1Hr0iKvIh=VC1_D82372B12D7B53586A35B377B0BA35AA_TGubUNxIvYxaxuTMm1Z5JZUbPQ6bWDitEwFZG9ffGRyWDAfXfJCilDv822AT249H4an_Uemgm3UQcbg6fBKlhDQNmjLvjGiUQH6ZJcfaerqp9puL2JVfKq1d049P2OFFI0Hx-z5HhbgZB8ErajYfZw==; __popdest=; csrftoken=f4622aa1af9a235d91ed9e1907a2b742; MADUCAT=1&1207&BK14891&BK31234&BK29926&BK29419&BK25743&BK25738&BK25728&BK25700&BK25689&BK25676&BK25659&BK25658&BK25656&BK25655&BK25654&BK25653&BK25650&BK25649&BK25638&BK25637&BK24202&BK21186&BK17923&BK17920&BK17316&BK16915&BK16212&BK16199&BK16088&BK14583&BK13323&BK13306&BK12281&BK12267&BK12266&BK12264&BK12253&BK12252&BK12251&BK12249; __utma=141309943.445345160.1354835927.1354897264.1354902439.8; __utmb=141309943.13.10.1354902439; __utmc=141309943; __utmz=141309943.1354836107.2.2.utmcsr=google|utmccn=(organic)|utmcmd=organic|utmctr=(not%20provided); COUNTRY=UK; REGION=UK; sessionid=e05b5fd5257cc189781496d42ddf6f16",            } # MLP BODY = "inp=%5B%7B%22list_id%22%3A%22SpecialFeatures%3Alist%3Abest-animated-series%22%2C%22id%22%3A%22s%3A79180%22%2C%22a%22%3A%22a%22%2C%22v%22%3A%22%2B1%22%2C%22vote_rate_limit%22%3A%223%22%7D%5D&csrfmiddlewaretoken=f4622aa1af9a235d91ed9e1907a2b742" HEADERS["Content-Length"] = "242"   # FG #BODY = "inp=%5B%7B%22list_id%22%3A%22SpecialFeatures%3Alist%3Abest-animated-series%22%2C%22id%22%3A%22s%3A390%22%2C%22a%22%3A%22a%22%2C%22v%22%3A%22%2B1%22%2C%22vote_rate_limit%22%3A%223%22%7D%5D&csrfmiddlewaretoken=f4622aa1af9a235d91ed9e1907a2b742" #HEADERS["Content-Length"] = "240"   # SW #BODY = "inp=%5B%7B%22list_id%22%3A%22SpecialFeatures%3Alist%3Abest-animated-series%22%2C%22id%22%3A%22s%3A4204%22%2C%22a%22%3A%22a%22%2C%22v%22%3A%22%2B1%22%2C%22vote_rate_limit%22%3A%223%22%7D%5D&csrfmiddlewaretoken=f4622aa1af9a235d91ed9e1907a2b742" #HEADERS["Content-Length"] = "241"   class Worker(Thread):     def __init__(self, queue):         Thread.__init__(self)         self.queue = queue         self.httpServ = httplib.HTTPConnection("www.tv.com")       def run(self):         while not self.queue.empty():             self.httpServ.connect()             r = self.queue.get()             self.httpServ.request("POST", "/lists/update/", BODY, HEADERS)             response = self.httpServ.getresponse()             if response.status != httplib.OK:                 self.queue.put(r)             self.httpServ.close()   def test():     print "Creating..."     httpServ = httplib.HTTPConnection("www.tv.com")     print "Connecting..."     httpServ.connect()     print "Connected! Issuing order..."     httpServ.request("POST", "/lists/update/", BODY, HEADERS)     print "Waiting for response..."     response = httpServ.getresponse()     if response.status == httplib.OK:         print response.read()     else:         print "Failed :("     httpServ.close()   def run(count, threads):     queue = Queue()     for i in xrange(count):         queue.put(i)       for i in xrange(threads):         w = Worker(queue)         w.start()     a = time.clock()     while not queue.empty():         print "+%s" % (count - queue.qsize())         time.sleep(1)     print time.clock() - a             print "+%s - done!" % count   if __name__ == '__main__':     test()     while True:         run(1000, 1)         time.sleep(5)