Advertisement
Guest User

For_teh_leader_v3.vbs

a guest
Nov 27th, 2012
2,165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.46 KB | None | 0 0
  1. Function httpGet(url, ByRef cookie, debug)
  2.  
  3. 'Set dummy cookie, if none (or "") provided
  4. Trim(cookie)
  5. If len(cookie) = 0 Then
  6. cookie = ""
  7. End If
  8.  
  9. 'Initialize XMLHttp Object
  10. 'Use the best/proper XMLHttp object available on your system
  11. Set XMLHTTP = CreateObject("MSXML2.ServerXMLHTTP")
  12. 'Set XMLHTTP = CreateObject("Msxml2.XMLHTTP")
  13. 'Set XMLHTTP = CreateObject("Microsoft.XMLHTTP")
  14.  
  15. 'Set up GET request (synchronous)
  16. XMLHTTP.open "GET", Trim(url), False
  17.  
  18. 'Set (optional) cookie
  19. If len(cookie) <> 0 Then
  20. XMLHTTP.setRequestHeader "Cookie", "excuse the Microsoft bug"
  21. XMLHTTP.setRequestHeader "Cookie", cookie
  22. end if
  23.  
  24. 'Proxy
  25. 'XMLHTTP.setProxy 2, "202.70.34.10:81", ""
  26. 'XMLHTTP.setProxy 2, "202.70.34.10:80", ""
  27.  
  28. 'Make request
  29. XMLHTTP.send "" 'send no/blank data since is GET request
  30.  
  31. 'wait for response
  32. While XMLHTTP.readyState <> 4
  33. XMLHTTP.waitForResponse 1000
  34. Wend
  35.  
  36. 'Parse response cookie headers & can be used for session state persistence
  37. Dim strHeaders, hArr, kk, theCookie
  38. strHeaders = XMLHTTP.getAllResponseHeaders()
  39. hArr = Split(strHeaders,"Set-Cookie: ")
  40. For kk = 1 To Ubound(hArr)
  41. theCookie = Left(hArr(kk),Instr(hArr(kk),"path=/")-2)
  42. cookie = cookie & " " & theCookie
  43. Next
  44.  
  45. 'Return response content
  46. If debug = False Then
  47. httpGet = XMLHTTP.responseText
  48. Else
  49. 'return response headers + content for debugging
  50. httpGet = strHeaders & XMLHTTP.responseText
  51. End If
  52. Set XMLHTTP = Nothing
  53. End Function
  54.  
  55. Dim sessionCookie
  56. sessionCookie = ""
  57.  
  58. 'Make GET request to some URL with optional GET query parameters
  59. dim sID, eID
  60. dim voteID, reqID
  61.  
  62. dim sleepOff, offRang, sleepBan, banRange, coolDown
  63.  
  64. coolDown = 4
  65.  
  66. sleepOff = 6000
  67. sleepBan = 1000 * 60 * 60 * coolDown
  68.  
  69. offRang = 3
  70. banRange = 1
  71.  
  72.  
  73. Dim fso, outFile
  74. Set fso = CreateObject("Scripting.FileSystemObject")
  75. Set outFile = fso.CreateTextFile("output.txt", True)
  76.  
  77. Do while true
  78.  
  79. 'Get Voting ID
  80. reqID = "http://polldaddy.com/n/113df4577acffec0e03c79cfc7210eb6/6685610?********"
  81. Randomize
  82. sessionCookie = ""
  83. reqID = replace(reqID, "********", int(rnd() * 10000000000000) & "")
  84. 'WScript.Echo reqID
  85. voteID = httpGet(reqID,sessionCookie,False)
  86. 'WScript.Echo voteID
  87. 'Truncate and make pretty ... yes?
  88. sID = InStr(1, voteID, "PDV_n6685610='", 1) + Len("PDV_n6685610='")
  89. eID = InStrRev(voteID, "';", -1, 1)
  90.  
  91. voteID = mid(voteID, sID, eID - sID)
  92.  
  93. Randomize
  94.  
  95. WScript.sleep ((int(rnd * (offRang + 1)) + 1) * sleepOff)
  96.  
  97. 'WScript.Echo voteID
  98.  
  99. 'DO THE DAMN VOTE
  100. Dim GODLY_VOTE, YES
  101. GODLY_VOTE = "http://polls.polldaddy.com/vote-js.php?p=6685610&b=1&a=30279773,&o=&va=16&cookie=0&url=http%3A//www.time.com/time/specials/packages/article/0%2C28804%2C2128881_2128882_2129192%2C00.html&n=********"
  102. 'GODLY_VOTE = "http://polls.polldaddy.com/vote-js.php?p=6685610&b=1&a=33279773,&o=&va=16&cookie=0&url=http%3A//www.time.com/time/specials/packages/article/0%2C28804%2C2128881_2128882_2129192%2C00.html&n=********"
  103. GODLY_VOTE = replace(GODLY_VOTE, "********", voteID)
  104.  
  105. 'FOR THE LEADER
  106. 'WScript.Echo sessionCookie
  107. YES = httpGet(GODLY_VOTE,sessionCookie,False)
  108. ' Response can be read like this:
  109. 'WScript.Echo YES
  110.  
  111. if InStr(1, YES, "Cooling Off", 1) <> 0 then
  112. 'WScript.Echo YES
  113. outFile.writeLine(NOW() & vbTab & "Sleeping due to a ban")
  114. WScript.sleep ((int(rnd * (banRang + 1)) + 1) * sleepBan)
  115. else
  116. outFile.writeLine(NOW() & vbTab & "Made a successful vote to our leader!!!")
  117. end if
  118.  
  119. Loop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement