예제 #1
0
def overwrite_from_csv(fn, token):
    data = data_load(f_n=fn)

    for row in data:
        d = {}
        d["component_type"] = row[6]
        if row[7]:
            d["related_to_id"] = int(row[7])
        else:
            d["related_to_id"] = None
        print(row[1], row[5], row[6])
        fetch_api.updated_sentence(row[1], token, d)
예제 #2
0
def elephant():
    # 一個前の投稿
    token_elephant = fetch_api.get_access_token("Elephant", "test")
    d = {"title": "publicness", "body": "I think ... "}
    fetch_api.create_thread(token_elephant, d)
    d = {
        "title":
        "No.4 should be abolished",
        "body":
        "Since there is a possibility that the report of the present stage has been conveniently reported by editing,\n does not it change so much even if it is abolished?"
    }
    fetch_api.create_thread(token_elephant, d)

    # 一個前の投稿の色付け
    d = {"component_type": "PREMISE", "related_to_id": 4}
    fetch_api.updated_sentence(3, token_elephant, d)
    # 一個前の投稿の色付け
    d = {"component_type": "CLAIM", "related_to_id": None}
    fetch_api.updated_sentence(4, token_elephant, d)
예제 #3
0
def overwrite(token):
    updates = [["PREMISE", 33, 32], ["CLAIM", 24, 33], ["PREMISE", 33, 34]]
    for update in updates:
        d = {"component_type": update[0], "related_to_id": update[1]}
        fetch_api.updated_sentence(update[2], token, d)
예제 #4
0
def otter1_coloed(token):
    d = {"component_type": "PREMISE", "related_to_id": 6}
    fetch_api.updated_sentence(5, token, d)
    d = {"component_type": "CLAIM", "related_to_id": None}
    fetch_api.updated_sentence(6, token, d)