Skip to content

Instantly share code, notes, and snippets.

@kungfufighting
Forked from kingbin/polldaddy_v2.rb
Last active December 16, 2015 17:59
Show Gist options
  • Save kungfufighting/5474229 to your computer and use it in GitHub Desktop.
Save kungfufighting/5474229 to your computer and use it in GitHub Desktop.
# Using the web automation driver (watir-webdriver) through the tor network
# Automates webpage actions & bypasses the voting limit on polldaddy
# Casts a vote every 3 seconds for a total of 1000 votes
require 'watir-webdriver'
profile = Selenium::WebDriver::Firefox::Profile.new
profile.proxy = Selenium::WebDriver::Proxy.new :http => '127.0.0.1:8118'
b = Watir::Browser.new :firefox, :profile => profile
#b = Watir::Browser.new :firefox
b.goto '/polldaddy.com/poll/7040303/'
(1..1000).each do |i|
b.radio(:id => 'PDI_answer31983122').set
b.link(:id => 'pd-vote-button7040303').click
b.link(:href, 'javascript:PD_vote7040303();').click
puts 'Another vote! ' #<< b.span(:class => 'pds-feedback-votes').text.to_s
sleep(3)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment