I did this by creating a rake task and using the one-time dynodes mentioned by XLII
Here is my rake task file
require 'bundler/setup' Bundler.require desc "Scrape Site" task :scrape, [:companyname] => :environment do |t, args| puts "Company Name is :" + args[:companyname] agent = Mechanize.new agent.user_agent_alias = 'Mac Safari' puts "Agent (Mac Safari Created)"
You can just run it on call
heroku run rake scrape[google]
source share