Created
          December 4, 2010 16:10 
        
      - 
      
- 
        Save resistorsoftware/728287 to your computer and use it in GitHub Desktop. 
    Ever wanted to open the door by rubbing your magic lamp
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | 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