From 7e060e5cf2656a0a53d41ea0ff42b753316cd441 Mon Sep 17 00:00:00 2001 From: mia Date: Fri, 4 Oct 2024 15:43:40 -0700 Subject: she's goin --- conf_pain.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'conf_pain.py') 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 -- cgit 1.4.1