Esempio n. 1
0
        result["star_num"] = utils.format_star_num(star_num, 2)
        result["min_sdk_version"] = 0

    return result


def analyze(c_id, html):
    basic_info = {}
    if html:
        basic_info = get_basic_info(html)
        # utils.show_dict(basic_info)
        if not utils.is_dict_none(basic_info):
            basic_info["is_parse"] = 1
        else:
            basic_info["is_parse"] = -1
        basic_info["c_id"] = c_id
    return basic_info


if __name__ == '__main__':
    # n = "刀塔传奇"
    # n = "我爱猜动画片"
    # n = "欢乐斗地主(QQ游戏官方版)"
    n = "极限单车"
    c = "应用宝"
    h = get_crawler_info(c, n)
    # print h[0]
    info = analyze(0, h[0])
    utils.show_dict(info)
    print "end"
Esempio n. 2
0
        result["size"] = size
        result["min_sdk_version"] = utils.format_android_level(api_level)
        result["star_num"] = utils.format_star_num(star_percent)
        result["short_desc"] = short_desc or ""

    return result


def analyze(c_id, html):
    basic_info = {}
    if html:
        basic_info = get_basic_info(html)
        if not utils.is_dict_none(basic_info):
            basic_info["is_parse"] = 1
        else:
            basic_info["is_parse"] = -1
        basic_info["c_id"] = c_id
    return basic_info


if __name__ == '__main__':
    # test()
    # n = "捕鱼达人2"
    n = "天天挂机"
    c = "百度"
    h = get_crawler_info(c, n)
    # print h[0]
    info = analyze(0, h[0])
    utils.show_dict(info)
    print "end"