promo_alert.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:ShiokBot 作者: kianhean 项目源码 文件源码
def get_new_codes():
    """ Return New Codes and Refresh DB"""
    db = dataset.connect(database_url)
    new_codes = get_code()

    table = db['promo']

    """ Get New Codes"""
    new = {}

    for key, value in new_codes.items():

        if table.find_one(promo=key) is None:
            new[key] = [new_codes[key][0], new_codes[key][1]]
        else:
            pass

    """ Add to DB """
    for key in new:
        table.insert(dict(promo=key, desc=new_codes[key][1], exp=new_codes[key][0]))

    return new
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号