def set_types(items):
    for i in items:
        if tokenPattern.match(i["target"]) or addressPattern.match(
                i["target"]):
            i["type"] = "boost"
        elif i.get("about"):
            if tokenPattern.match(i["about"]):
                i["type"] = "post_to"
            elif addressPattern.match(i["about"]):
                i["type"] = "post_to_simple"
            else:
                i["type"] = "post_about"
        else:
            i["type"] = "regular"
def set_type(i):
    if tokenPattern.match(i["target"]) or addressPattern.match(i["target"]):
        i["type"] = "boost"
    elif i["about"]:
        if claimPattern.match(i["about"]):
            i["type"] = "regular"
        elif tokenPattern.match(i["about"]):
            i["type"] = "post_to"
        elif addressPattern.match(i["about"]):
            i["type"] = "post_to_simple"
        elif assetPattern.match(i["about"]):
            i["type"] = "post_club"
        else:
            i["type"] = "post_about"
    else:
        i["type"] = "regular"
Beispiel #3
0
def remove_non_matching_ids(result):
    return {
        "items": [
            item for item in result["items"] if
            addressPattern.match(item["id"]) or tokenPattern.match(item["id"])
        ]
    }
def set_type(i):
    if i.get("reply_to"):
        i["type"] = "response"
    elif tokenPattern.match(i["target"]) or addressPattern.match(i["target"]):
        i["type"] = "boost"
    elif i.get("label") in ["github", "twitter", "instagram", "facebook", "discord", "telegram"]:
        i["type"] = "social"
    elif i["about"]:
        if tokenPattern.match(i["about"]):
            i["type"] = "post_to"
        elif addressPattern.match(i["about"]):
            i["type"] = "post_to_simple"
        elif assetPattern.match(i["about"]):
            i["type"] = "post_club"
        else:
            i["type"] = "post_about"
    else:
        i["type"] = "regular"