Skip to content

Instantly share code, notes, and snippets.

@mguterl
Forked from dougalcorn/Vote for BudgetSketch.rb
Created June 16, 2009 22:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mguterl/130956 to your computer and use it in GitHub Desktop.
Save mguterl/130956 to your computer and use it in GitHub Desktop.
# 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'
raise "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'
}
page = a.get('http://cincinnatiinnovates.com/contest/vote_form/25')
vote_result = page.forms.first
vote_result['vote[first_name]'] = ARGV[0]
vote_result['vote[last_name]'] = ARGV[1]
vote_result['vote[email_confirmation]'] = vote_result['vote[email]'] = ARGV[2]
vote_result.submit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment