Exemplo n.º 1
0
def checkin(account):
    user = User()
    user.loadCookie(account["cookie"])
    if not user.islogined and account["password"]:
        user.login(account["email"], account["password"])
    if user.islogined:
        if not user.ischeckined:
            days = user.checkin()
            if days:
                account["days"] = days
            else:
                account["errcount"] += 1
                account["nexttime"] = time.time() + 600
                account["status"] = u'\u7b7e\u5230\u5931\u8d25'
        else:
            days = int(user["sign"]["persist_num"])
            account["nexttime"] = time.time() + 3600
        account["status"] = u'\u6ca1\u6709\u5f02\u5e38'
    else:
        account["errcount"] += 1
        account["nexttime"] = time.time() + 600
        account["status"] = u'\u767b\u5f55\u5931\u8d25'
    account["last"] = time.time()
    xiamidb.update(**account)
Exemplo n.º 2
0
def checkin(account):
    user = User()
    user.loadCookie(account["cookie"])
    if not user.islogined and account["password"]:
        user.login(account["email"],account["password"])
    if user.islogined:
        if not user.ischeckined:
            days = user.checkin()
            if days:
                account["days"] = days
            else:
                account["errcount"] += 1
                account["nexttime"] = time.time() + 600
                account["status"] = u'\u7b7e\u5230\u5931\u8d25'
        else:
            days = int(user["sign"]["persist_num"])
            account["nexttime"] = time.time() + 3600
        account["status"] = u'\u6ca1\u6709\u5f02\u5e38'
    else:
        account["errcount"] += 1
        account["nexttime"] = time.time() + 600
        account["status"] = u'\u767b\u5f55\u5931\u8d25'
    account["last"] = time.time()
    xiamidb.update (**account)