Last active
October 9, 2024 03:14
-
-
Save Samsinite/0ce11b2bd62cdb9d041bfb4fe6bd4480 to your computer and use it in GitHub Desktop.
Poll Daddy Poll submitter
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
#!/usr/bin/env ruby | |
require 'open-uri' | |
poll_id = ARGV[0] # var PDV_h... value in https://secure.polldaddy.com/p/1XXXXXXXXX.js request JS file | |
poll_number = ARGV[1] # p= param in https://polls.polldaddy.com/vote-js.php req | |
pick = ARGV[2] # a= param in https://polls.polldaddy.com/vote-js.php req minus the comma | |
tags = ARGV[3] # tags= param minus the src-... stuff in https://polls.polldaddy.com/vote-js.php req | |
referer = ARGV[4] # url= param in https://polls.polldaddy.com/vote-js.php req | |
COOKIE_URI = "https://polldaddy.com/n/#{poll_id}/#{poll_number}?#{Time.now.to_i.to_s}" | |
VOTE_URI = "http://polls.polldaddy.com/vote-js.php?p=#{poll_number}&b=0&a=#{pick},&o=&va=16&cookie=0&tags=#{tags}-src:poll-embed&url=#{referer}" | |
USER_AGENT = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36' | |
COOKIE_HEADERS = { | |
'User-Agent' => USER_AGENT | |
} | |
VOTE_HEADERS = { | |
'User-Agent' => USER_AGENT, | |
'Host' => 'polls.polldaddy.com', | |
'Referer' => referer | |
} | |
def get_cookie | |
puts '------Request For The Magic CoOkie!--------' | |
resp = URI.open(COOKIE_URI, **COOKIE_HEADERS).read | |
puts "COOKIE: #{resp}" | |
puts resp.split(';')[0] | |
cookie = resp.split(';')[0][15...-1] | |
puts cookie | |
cookie | |
end | |
def vote(cookie) | |
vote_uri_with_cookie_and_referer = "#{VOTE_URI}&n=#{cookie}" | |
resp = URI.open(vote_uri_with_cookie_and_referer, **VOTE_HEADERS).read | |
puts "Vote RESPONSE: #{resp}" | |
end | |
while true | |
vote(get_cookie) | |
sleep(61) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment