diff options
author | mia <mia@mia.jetzt> | 2024-09-04 04:47:13 -0700 |
---|---|---|
committer | mia <mia@mia.jetzt> | 2024-09-04 04:47:13 -0700 |
commit | bb8a48fd4d85ba4f8224c68aaaf9069d5d79dae2 (patch) | |
tree | bdb0654c667f37c69addc9efd1e29b9cfe710c51 /4_delete.py | |
parent | 81071e8feefdf815e29318226c668664e1706da2 (diff) | |
download | scrubber-bb8a48fd4d85ba4f8224c68aaaf9069d5d79dae2.tar.gz scrubber-bb8a48fd4d85ba4f8224c68aaaf9069d5d79dae2.zip |
desktop changes
Diffstat (limited to '4_delete.py')
-rw-r--r-- | 4_delete.py | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/4_delete.py b/4_delete.py new file mode 100644 index 0000000..51e1ef3 --- /dev/null +++ b/4_delete.py @@ -0,0 +1,33 @@ +from pathlib import Path + +import httpx +import psycopg + +from com import eval_config, parse_graph, progressbar + +config = eval_config() +conn: psycopg.Connection = config["connect"]() +token: str = config["token"] +api: str = config["api"] + +graph = parse_graph() +print("reading filterlist") +filtered = Path("filtered.list").read_text().strip().splitlines() + +queue = [] + +def enqueue(note): + for reply in note["replies"]: + enqueue(graph[reply]) + for quote in note["quotes"]: + enqueue(graph[quote]) + if "self" in note["flags"]: + files = conn.execute('select "fileIds" from note where id = %s', [note["id"]]).fetchone()[0] + queue.append((note["id"], files)) + +for id in filtered: + enqueue(graph[id]) + +print(queue) + +# client = httpx.Client() |