    # File lib/termtter/api.rb, line 52
          def authorize_by_oauth(show_information=false, save_to_token_file=true, put_to_config=true, verbose=true)
            puts '1. Connecting to twitter...' if verbose

            request_token = consumer.get_request_token

            puts '2. Authorization URL: ' + request_token.authorize_url if verbose
            puts '   Opening authorization web page...' if verbose

            begin
              open_browser(request_token.authorize_url)
            rescue BrowserNotFound
              puts "Browser not found. Please log in and/or grant access to get PIN via your browser at #{request_token.authorize_url}"
            end
            sleep 2

            ui = create_highline
            pin = ui.ask('3. Enter PIN: ')
            puts ""
            puts "4. Fetching access_token..."
            access_token = request_token.get_access_token(:oauth_verifier => pin)

            if put_to_config
              config.access_token = access_token.token
              config.access_token_secret = access_token.secret
            end

            if save_to_token_file
              puts "5. Saving to token file... (" + config.token_file + ")"
              open(File.expand_path(config.token_file),"w") do |f|
                f.puts access_token.token
                f.puts access_token.secret
              end
            end

            puts "Authorization successfully completed."

            return {:token  => access_token.token,
                    :secret => access_token.secret}
          end