def login
      uri = URI('https://www.google.com/accounts/ClientLogin')

      q = { 'service'      => 'sj',
            'account_type' => 'GOOGLE',
            'source'       => 'ruby-skyjam-%s' % SkyJam::VERSION,
            'Email'        => @account,
            'Passwd'       => @password }

      http = Net::HTTP.new(uri.host, uri.port)
      http.use_ssl = true

      req = Net::HTTP::Post.new(uri.path)
      req.set_form_data(q)
      res = http.request(req)

      unless res.is_a? Net::HTTPSuccess
        fail Error, 'login failed: #{res.code}'
      end

      tokens = Hash[*res.body
                        .split("\n")
                        .map { |r| r.split('=', 2) }
                        .flatten]
      @sid = tokens['SID']
      @auth = tokens['Auth']
    end
def login
      uri = URI('https://www.google.com/accounts/ClientLogin')

      q = { 'service'      => 'sj',
            'account_type' => 'GOOGLE',
            'source'       => 'ruby-skyjam-%s' % SkyJam::VERSION,
            'Email'        => @account,
            'Passwd'       => @password }

      http = Net::HTTP.new(uri.host, uri.port)
      http.use_ssl = true

      req = Net::HTTP::Post.new(uri.path)
      req.set_form_data(q)
      res = http.request(req)

      unless res.is_a? Net::HTTPSuccess
        fail Error, 'login failed: #{res.code}'
      end

      tokens = Hash[*res.body
                        .split("\n")
                        .map { |r| r.split('=', 2) }
                        .flatten]
      @sid = tokens['SID']
      @auth = tokens['Auth']
    end
Simple auth
 login: with app-specific password, obtain auth token
 cookie: with auth token, obtain cross token (xt)
 loadalltracks: with auth token and cross token, obtain list of tracks