diff --git a/hypopub.py b/hypopub.py index 4874bcf..48e520b 100644 --- a/hypopub.py +++ b/hypopub.py @@ -19,6 +19,8 @@ session = requests.session() token = os.getenv("MICROPUB_TOKEN") session.headers = {"Authorization": f"Bearer {token}"} +HYPOTHESIS_USER=os.getenv("HYPOTHESIS_USER") + def send_micropub(entry: atoma.atom.AtomEntry): # get the json corresponding to the annotation @@ -49,7 +51,10 @@ def send_micropub(entry: atoma.atom.AtomEntry): def main(): - response = requests.get("https://hypothes.is/stream.atom?user=ravenscroftj") + if HYPOTHESIS_USER is None: + raise Exception("You must set HYPOTHESIS_USER environment variable") + + response = requests.get(f"https://hypothes.is/stream.atom?user={HYPOTHESIS_USER}") feed = atoma.parse_atom_bytes(response.content) print(f"Processing {feed.title.value}")