Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
12 lines (8 sloc) 299 Bytes
require 'mechanize'
def vote
agent = WWW::Mechanize.new
user_agents = ['Windows IE 6', 'Windows IE 7', 'Windows Mozilla', 'Mac Safari', 'Mac FireFox', 'Mac Mozilla']
random_user_agent = user_agents[(rand * user_agents.size).floor]
agent.user_agent_alias = random_user_agent
page =
end