🗝
summary refs log tree commit diff
path: root/conf_pain.py
diff options
context:
space:
mode:
authormia <mia@mia.jetzt>2024-10-04 15:43:40 -0700
committermia <mia@mia.jetzt>2024-10-04 15:43:40 -0700
commit7e060e5cf2656a0a53d41ea0ff42b753316cd441 (patch)
tree2629f3d1e12d21c406974000dd195518aa5b6041 /conf_pain.py
parentbb8a48fd4d85ba4f8224c68aaaf9069d5d79dae2 (diff)
downloadscrubber-7e060e5cf2656a0a53d41ea0ff42b753316cd441.tar.gz
scrubber-7e060e5cf2656a0a53d41ea0ff42b753316cd441.zip
she's goin
Diffstat (limited to 'conf_pain.py')
-rw-r--r--conf_pain.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/conf_pain.py b/conf_pain.py
index 85e7095..9690de1 100644
--- a/conf_pain.py
+++ b/conf_pain.py
@@ -1,14 +1,17 @@
 import math
 from datetime import UTC, datetime, timedelta
 
-from com import FilterableNote
+from com import FilterableNote, FilterAction
 from sec import connect, tokens
 
 user_id = "9gszslkcdfnomssj"
 token = tokens["pain"]
-api = "https://void.rehab/api/"
+api = "https://void.rehab/api"
 
-def criteria(root: FilterableNote) -> bool:
+def criteria(root: FilterableNote) -> (bool, FilterAction):
     # if it's more than two months old, delete
-    # return (datetime.now(UTC) - root.when).days > 60
-    return (datetime.now(UTC) - root.when).days > (12 * 30)
+    latest = max(map(lambda note: note.when, root.thread_self()))
+    if (datetime.now(UTC) - latest).days > 60:
+        return FilterAction.Obliterate
+    else:
+        return FilterAction.Ignore