diff options
author | mia <mia@mia.jetzt> | 2024-10-04 15:43:40 -0700 |
---|---|---|
committer | mia <mia@mia.jetzt> | 2024-10-04 15:43:40 -0700 |
commit | 7e060e5cf2656a0a53d41ea0ff42b753316cd441 (patch) | |
tree | 2629f3d1e12d21c406974000dd195518aa5b6041 /conf_pain.py | |
parent | bb8a48fd4d85ba4f8224c68aaaf9069d5d79dae2 (diff) | |
download | scrubber-7e060e5cf2656a0a53d41ea0ff42b753316cd441.tar.gz scrubber-7e060e5cf2656a0a53d41ea0ff42b753316cd441.zip |
she's goin
Diffstat (limited to 'conf_pain.py')
-rw-r--r-- | conf_pain.py | 13 |
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 |