Skip to content

Instantly share code, notes, and snippets.

@dougalcorn
Created June 9, 2009 18:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save dougalcorn/126698 to your computer and use it in GitHub Desktop.
Save dougalcorn/126698 to your computer and use it in GitHub Desktop.
Vote for BudgetSketch
# 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