 
 # TODO: logger 分级控制
 log   = console.log
+
+
+exports.cookies = ->
+    all_cookies
+
 
 # 是否需要 验证码
 # @param qq



# "http://d.web2.qq.com/channel/login2"
exports.login_token = (callback) ->

    client_id = parseInt(Math.random() * 100000000)
    ptwebqq   = all_cookies.filter( (item)->item.match /ptwebqq/ )
                           .pop()

            'Cookie' : all_cookies
    
    req = http.request options, (resp) ->
        log "login token response: #{resp.statusCode}"
        resp.on 'data', (chunk) ->
            body += chunk
        resp.on 'end', ->
            ret = JSON.parse(body)
            callback( ret , client_id )
                    
    req.write(data);
    req.end();
