Created
June 9, 2009 18:19
-
-
Save dougalcorn/126698 to your computer and use it in GitHub Desktop.
Vote for BudgetSketch
This file contains 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
# This is for voting for the budgetsketch project on http://cinciinnovates.com | |
# You can vote daily. This stupid simple mechanize script will simply submit | |
# your vote. You still have to confirm the vote from your email inbox. I | |
# figure a cron job to submit my vote keeps me from forgetting to vote daily | |
# and I (as a human) am still confirming; so not cheating. YMMV | |
require 'rubygems' | |
require 'mechanize' | |
require 'pp' | |
puts "expecting first_name last_name email as command line arguments" unless ARGV.size == 3 | |
a = WWW::Mechanize.new { |agent| | |
agent.user_agent_alias = 'Mac Safari' | |
} | |
a.get('http://cincinnatiinnovates.com/contest/vote_form/25') do |page| | |
vote_result = page.form_with(:name => 'vote_form') do |form| | |
form['vote[first_name]'] = ARGV[0] | |
form['vote[last_name]'] = ARGV[1] | |
form['vote[email_confirmation]'] = form['vote[email]'] = ARGV[2] | |
end.submit | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment