mirror of
https://git.mia.jetzt/scrubber
synced 2024-11-24 06:17:23 -07:00
17 lines
525 B
Python
17 lines
525 B
Python
import math
|
|
from datetime import UTC, datetime, timedelta
|
|
|
|
from com import FilterableNote, FilterAction
|
|
from sec import connect, tokens
|
|
|
|
user_id = "9gszslkcdfnomssj"
|
|
token = tokens["pain"]
|
|
api = "https://void.rehab/api"
|
|
|
|
def criteria(root: FilterableNote) -> (bool, FilterAction):
|
|
# if it's more than two months old, delete
|
|
latest = max(map(lambda note: note.when, root.thread_self()))
|
|
if (datetime.now(UTC) - latest).days > 60:
|
|
return FilterAction.Obliterate
|
|
else:
|
|
return FilterAction.Ignore
|