Skip to content

Instantly share code, notes, and snippets.

@dav-s
Last active February 13, 2018 05:41
Show Gist options
  • Save dav-s/2eade308129175494643 to your computer and use it in GitHub Desktop.
Save dav-s/2eade308129175494643 to your computer and use it in GitHub Desktop.
pd
import httplib
import time
p = "8438346"
b = "0"
a = "38392389,"
o = ""
va = "0"
cookie = "0"
url = "http%3A//usatodayhss.com/2014/poll-which-high-school-in-the-greater-houston-area-has-the-most-spirit-this-week-7"
hsurl = "polldaddy.com"
hsconn = httplib.HTTPSConnection(hsurl)
hurl = "polls.polldaddy.com"
hconn = httplib.HTTPConnection(hurl)
nvotes = 0
while True:
if nvotes%10==0:
print "Initializing Sleep Mode"
time.sleep(10)
hsreqstr = "/n/95033322640cd3220f75335dac7e6adf/%s?" % p
hsconn.request("GET", hsreqstr)
#print hsreqstr
getreq = hsconn.getresponse()
gresp = getreq.read()
#print gresp
n = gresp.split("'")[1]
hreqstr = "/vote-js.php?p=%s&b=%s&a=%s,&o=%s&va=%s&cookie=%s&n=%s\&url=%s" % (p, b, a, o, va, cookie, n, url)
time.sleep(2.5)
hconn.request("GET", hreqstr)
#print hreqstr
preq = hconn.getresponse()
presp = preq.read()
#print presp
if presp[0:2] == 'PD' and len(presp) > 100:
nvotes += 1
print "(%s) %s Successful Votes" % (n, str(nvotes))
else:
print "Unsuccessful Vote"
time.sleep(2.5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment