implement copying tags + hypothesis metadata
This commit is contained in:
parent
676a2e876a
commit
2f34a0deba
|
@ -37,17 +37,22 @@ def send_micropub(entry: atoma.atom.AtomEntry):
|
|||
|
||||
|
||||
endpoint = os.getenv("MICROPUB_ENDPOINT")
|
||||
session.post(f"{endpoint}", json={
|
||||
r = session.post(f"{endpoint}", json={
|
||||
"type": ["h-entry"],
|
||||
"properties":{
|
||||
"published": [entry.published.strftime("%Y-%m-%dT%H:%M:%S")],
|
||||
"content":[{
|
||||
"html": entry.content.value
|
||||
}],
|
||||
"in-reply-to": [annotation['target'][0]['source']]
|
||||
"category": annotation['tags'] + ['hypothes.is'],
|
||||
"in-reply-to": [annotation['target'][0]['source']],
|
||||
"hypothesis-link": [json_link]
|
||||
}
|
||||
})
|
||||
|
||||
if r.status_code > 300:
|
||||
raise Exception(f"Request failed: {r.status_code}: {r.text}")
|
||||
|
||||
|
||||
def main():
|
||||
|
||||
|
|
Loading…
Reference in New Issue