Guest User

Untitled

a guest
Feb 27th, 2011
309
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.61 KB | None | 0 0
  1. import urllib.request
  2. from time import sleep
  3. import datetime
  4.  
  5. #McHeinrich, McFefeDiet, McApfel, McDöner:
  6. burger_ids = [b'56130', b'56248', b'57370', b'53631']
  7. proxys = open("proxyliste.txt").readlines()
  8.  
  9.  
  10. url = 'http://213.61.220.45:8080/registration/services/campaignWS'
  11.  
  12. while True:
  13.     for proxy in proxys:
  14.         print("Proxy: "+proxy.strip())
  15.         for burger_id in burger_ids:
  16.             print("Burger: "+str(burger_id))
  17.             data = b'<SOAP-ENV:Envelope xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"><SOAP-ENV:Body><tns:vote xmlns:tns=\"http://campaigns.mcd.neuedigitale.de\"><tns:campaignId>3325</tns:campaignId><tns:postId>'+burger_id+b'</tns:postId></tns:vote></SOAP-ENV:Body></SOAP-ENV:Envelope>'
  18.             req = urllib.request.Request(url)
  19.             req.add_data(data)
  20.             req.add_header('Content-Type', 'text/xml')
  21.             req.add_header('User-Agent', 'trolololololol')
  22.             req.set_proxy(proxy, 'http')
  23.  
  24.             for i in range(0,6):
  25.                 try:
  26.                     response = urllib.request.urlopen(req, timeout=10)
  27.                     the_page = str(response.read())
  28.  
  29.                     t = datetime.datetime.today()
  30.                    
  31.                     the_page=the_page[the_page.find('<ns1:out>')+9:the_page.find('</ns1:out>')]
  32.                     print("%s:%s:%sh: %s"%(t.hour, t.minute, t.second, the_page))
  33.  
  34.                 except Exception as exc:
  35.                     print("Error: %s" % exc )
  36.                     break
Advertisement
Add Comment
Please, Sign In to add comment