    # File lib/ramaze/contrib/facebook/facebook.rb, line 35
        def call method, opts = {}
          args = { :api_key => KEY,
                   :call_id => Time.now.to_f,
                   :format => 'JSON',
                   :v => '1.0',
                   :session_key => params[:session_key] || SESSION,
                   :method => method }.merge(opts).map{ |k,v|
                                                        "#{k}=" + case v
                                                                  when Hash
                                                                    v.to_json
                                                                  when Array
                                                                    v.join(',')
                                                                  else
                                                                    v.to_s
                                                                  end
                                                      }.sort

          data = Array["sig=#{Digest::MD5.hexdigest(args.join+SECRET)}", *args].join('&')

          begin
            ret = post(data)
          rescue Errno::ECONNRESET, Errno::EPIPE
            @server = connect
            retry
          end while ret.empty? and @server = connect

          ret = case
                when ret == 'true';    true
                when ret == 'false';   false
                when ret[0..0] == '"'; ret[1..-2]
                else
                  begin
                    JSON::parse(ret)
                  rescue JSON::ParserError
                    puts "Error parsing #{ret.inspect}"
                    raise
                  end
                end

          unless method == 'fql.query'
            ret = ret.first if ret.is_a? Array and ret.size == 1 and ret.first.is_a? Hash
          end

          raise Facebook::Error, ret['error_msg'] if ret.is_a? Hash and ret['error_code']

          ret
        ensure
          unless @keepalive
            @server.close
            @server = nil
          end
        end