Skip to content

Instantly share code, notes, and snippets.

@resistorsoftware
Created December 4, 2010 16:10
Show Gist options
  • Save resistorsoftware/728287 to your computer and use it in GitHub Desktop.
Save resistorsoftware/728287 to your computer and use it in GitHub Desktop.
Ever wanted to open the door by rubbing your magic lamp
post '/signup' do
if params[:code_text] == 'baba_black_sheep'
a = Mechanize.new
a.get('http://private.myshopifysite.com/') do |page|
logged_in = page.form_with(:action => '/password') do |f|
f.password = 'knock_knock'
end.submit
end
c = a.cookies.collect {|c| {:name => c.name, :value => c.value}}
c.each do |cc|
response.set_cookie(cc[:name], {:value => cc[:value], :domain => ".myshopifysite.com", :path => '/'})
end
redirect "http://private.myshopifysite.com"
end
haml :messed_up
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment