Skip to content

Instantly share code, notes, and snippets.

@dmclark
Created November 11, 2010 21:15
Show Gist options
  • Select an option

  • Save dmclark/673197 to your computer and use it in GitHub Desktop.

Select an option

Save dmclark/673197 to your computer and use it in GitHub Desktop.
def agent
agent = Mechanize.new { |a|
a.user_agent_alias = 'Mac Safari'
a.log = Logger.new('./site.log')
a.request_headers = {
"Referer" => "http://goroo.com/goroo/showTripPlanResults.htm",
"Origin" => "http://goroo.com/",
"X-Requested-With" => "XMLHttpRequest"
}
}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment