set hypothesis user env var
This commit is contained in:
parent
7155865493
commit
1dd0bbe1e4
|
@ -19,6 +19,8 @@ session = requests.session()
|
||||||
token = os.getenv("MICROPUB_TOKEN")
|
token = os.getenv("MICROPUB_TOKEN")
|
||||||
session.headers = {"Authorization": f"Bearer {token}"}
|
session.headers = {"Authorization": f"Bearer {token}"}
|
||||||
|
|
||||||
|
HYPOTHESIS_USER=os.getenv("HYPOTHESIS_USER")
|
||||||
|
|
||||||
def send_micropub(entry: atoma.atom.AtomEntry):
|
def send_micropub(entry: atoma.atom.AtomEntry):
|
||||||
|
|
||||||
# get the json corresponding to the annotation
|
# get the json corresponding to the annotation
|
||||||
|
@ -49,7 +51,10 @@ def send_micropub(entry: atoma.atom.AtomEntry):
|
||||||
|
|
||||||
def main():
|
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)
|
feed = atoma.parse_atom_bytes(response.content)
|
||||||
|
|
||||||
print(f"Processing {feed.title.value}")
|
print(f"Processing {feed.title.value}")
|
||||||
|
|
Loading…
Reference in New Issue