30 lines
893 B
Python
30 lines
893 B
Python
#!/usr/bin/env python3
|
|
|
|
import json
|
|
from mastodon import Mastodon
|
|
import sys
|
|
from InactiveUserManager import InactiveUserManager
|
|
|
|
if __name__ == "__main__":
|
|
CONFIG_FILE = "config.json"
|
|
|
|
try:
|
|
with open(CONFIG_FILE, "r") as f:
|
|
config = json.load(f)
|
|
API_BASE_URL = config["server_url"]
|
|
ACCESS_TOKEN = config["access_token"]
|
|
except Exception as e:
|
|
sys.exit(f"Fehler beim Laden der Konfigurationsdatei {CONFIG_FILE}: {e}")
|
|
|
|
try:
|
|
mastodon = Mastodon(
|
|
access_token=ACCESS_TOKEN,
|
|
api_base_url=API_BASE_URL
|
|
)
|
|
my_account = mastodon.me()
|
|
except Exception as e:
|
|
sys.exit(f"Fehler beim Verbinden mit der Instanz: {e}")
|
|
|
|
manager = InactiveUserManager(mastodon, 180)
|
|
manager.run()
|
|
print("\nUnd wie der legendäre Giovanni Trapatoni einst sagte: 'Ich habe fertig!'\n")
|