-
-
Save kingbin/1699540 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 'speakimge.wordpress.com/2012/01/25/under-the-covers/' | |
(1..1000).each do |i| | |
b.radio(:id => 'PDI_answer26523547').set | |
b.link(:id => 'pd-vote-button5876349').click | |
b.link(:href, 'javascript:PDV_go5876349();').click | |
puts 'Another vote! ' #<< b.span(:class => 'pds-feedback-votes').text.to_s | |
sleep(3) | |
end |
What are you using other than tor? I can only get TOR to work on socks, so how should I go about using the 'http' proxy?
If anyones script dies from the page throwing an error, put a rescue in there. Mine was dying with inconstant amounts of votes so the rescue keeps it going.
Also, don't forget to run through a proxy if the voting cast are close together. They will stop you for a brief time if too rapid. Netshade for mac does a good job when you throw it on auto-cycle proxies.
@mehh If you have tor running you can add these lines instead of line 7 and it should work through Tor
profile['network.proxy.socks'] = 'localhost'
profile['network.proxy.socks_port'] = 9150
profile['network.proxy.type'] = 1
Comes from the Selenium documentation.
Now we just gotta figure out captcha :-/
Any way to show the count of votes?.
Because i remove the # (sharp) from the line and it crash.