-
-
Save mguterl/130956 to your computer and use it in GitHub Desktop.
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' | |
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