Skip to content

Instantly share code, notes, and snippets.

View masonoise's full-sized avatar

Mason Jones masonoise

View GitHub Profile
USER_AGENT_ALIASES = ['Windows Mozilla', 'Mac Safari', 'Mac FireFox', 'Mac Mozilla', 'Linux Mozilla', 'Linux Firefox']
agent = Mechanize.new do |mech|
mech.open_timeout = 10
mech.read_timeout = 10
mech.follow_meta_refresh = true
mech.keep_alive = true
mech.max_history = 1
mech.user_agent_alias = USER_AGENT_ALIASES.sample
end
agent.set_proxy(proxy_ip, proxy_port, AppConfig.http_proxy.username, AppConfig.http_proxy.password)
@eric1234
eric1234 / maxhire.rb
Created July 14, 2011 17:03
Maxhire API Wrapper
# An API wrapper for the MaxHire API. Based on the ActiveResource API.
# Designed to keep the horrors of SOAP away from decent code :)
#
# USAGE
#
# Creating a new object
#
# a = Maxhire::Person.new
# a.first = 'Eric'
# a.last = 'Anderson'