 
         bills.fetched.push bill if bill.date? and bill.amount? and bill.pdfurl?
 
-    log.info "#{bills.fetched.length} bills retrieved"
+    log.info "#{bills.fetched.length} bill(s) retrieved"
 
     if not bills.fetched.length
-        next "No bills retrieved"
+        next "no bills retrieved"
     else
         next()

    tokenAuthOptions =
        method: 'POST'
        jar: true
        url: "#{monCompteUrl}/pages/connection/Login.aspx?link=HOME"
        qs:
            accessToken: ""

    billOptions =
        method: 'GET'
        jar: true
        uri: "#{monCompteUrl}/pages/billing/Invoice.aspx"

    log.info 'Getting appkey'
    request appKeyOptions, (err, res, body) ->
        return next err if err

        $ = cheerio.load body
        appKey = $('#PostForm input[name="appkey"]').attr "value"
        return next "Could not retrieve app key" if not appKey

        logInOptions.form.appkey = appKey



# Layer to login to Numéricable website.
logIn = (requiredFields, billInfos, data, next) ->
    accountUrl = "https://moncompte.numericable.fr"
    connectionUrl = "https://connexion.numericable.fr"
    appKeyOptions =
        method: 'GET'
        jar: true
        url: "#{accountUrl}/pages/connection/Login.aspx"

    logInOptions =
        method: 'POST'
        jar: true
        url: "#{connectionUrl}/Oauth/Oauth.php"
        form:
            'action': "connect"
            'linkSSO': "#{connectionUrl}/pages/connection/Login.aspx?link=HOME"
            'appkey': ""
            'isMobile': ""

    redirectOptions =
        method: 'POST'
        jar: true
        url: connectionUrl

    signInOptions =
        method: 'POST'
        jar: true
        url: "#{connectionUrl}/Oauth/login/"
        form:
            'login': requiredFields.login
            'pwd': requiredFields.password
