diff --git a/.env.sample b/.env.sample index a5eac1e..6b3b669 100644 --- a/.env.sample +++ b/.env.sample @@ -1,2 +1,6 @@ +# lurker.vibe +API_URL="https://localhost/api/presences" +API_TOKEN="Bearer token" + # dbmate DATABASE_URL="" diff --git a/lurker/bot.py b/lurker/bot.py index 8f1fbc3..ae4d5bb 100644 --- a/lurker/bot.py +++ b/lurker/bot.py @@ -1,3 +1,4 @@ +import os import sys import typing from datetime import datetime @@ -10,8 +11,8 @@ from loguru import logger T = typing.TypeVar("T") FlushFunc = typing.Callable[[list[T]], typing.Coroutine[typing.Any, typing.Any, bool]] -API_URL = "https://requestbin.io/17ifjd71" -API_TOKEN = "" +API_URL = os.getenv("API_URL") +API_TOKEN = os.getenv("API_TOKEN") class SpotifyRecord(typing.NamedTuple): @@ -105,6 +106,10 @@ def main(argv: typing.Sequence[str]): print("Usage: lurker.py ") return 1 + if not API_URL: + print("Missing `API_URL` environment variable.") + return 1 + Bot().run(argv[0]) return 0