-
-
Save kungfufighting/5474108 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'open-uri' | |
pollNumber = '7040303' | |
ourPick = '31993122' | |
uriString = 'http://polldaddy.com/n/64270c358614e8ef9383968590e82f73/'.concat(7040303).concat('?').concat(Time.now.to_i.to_s()) | |
puts uriString | |
# Headers | |
HEADERS = { | |
'Host' => 'polldaddy.com', | |
'User-Agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_2) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.75 Safari/535.7', | |
'Referer' => 'http://maliweb.net/' | |
# 'Accept' => '*/*', | |
# 'Accept-Language' => 'en-US,en;q=0.8', | |
# 'Accept-Encoding' => 'gzip,deflate,sdch', | |
# 'Accept-Charset' => 'ISO-8859-1,utf-8;q=0.7,*;q=0.3', | |
# 'Keep-Alive' => '300', | |
# 'Connection' => 'keep-alive', | |
# 'Cache-Control' => 'max-age=0' | |
} | |
puts '------1st Request For The Magic CoOkie!--------' | |
res = open(uriString, HEADERS).read | |
puts res.split(';')[0] | |
cookie = res.split(';')[0][14,32] | |
puts cookie | |
puts '------2nd Request to Cast Our Vote!--------' | |
uriString = 'http://polls.polldaddy.com/vote-js.php?p=7040303'.concat(7040303).concat('&b=0&a=').concat(31983122).concat(',&o=&va=0&cookie=0&url=http%3A//polldaddy.com/poll/7040303/">Election Présidentielle 2013 : Pour qui voteriez-vous si l'élection se tenait en Juillet 2013 ?</a>').concat(cookie) | |
puts uriString | |
HEADERS['Host'] = 'polls.polldaddy.com' | |
HEADERS['Referer'] = 'http://polldaddy.com/poll/7040303/">Election Présidentielle 2013 : Pour qui voteriez-vous si l'élection se tenait en Juillet 2013 ?</a>/' | |
res = open(uriString, HEADERS).read | |
puts res |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment