From 3f368206fba3d0a67ab2e6895a364630f70e126c Mon Sep 17 00:00:00 2001 From: Adrien Raison Date: Sat, 13 Feb 2021 21:05:52 +0100 Subject: [PATCH] fisrt commit zotero linked --- src/zotero_joplin_binder/binder.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 src/zotero_joplin_binder/binder.py diff --git a/src/zotero_joplin_binder/binder.py b/src/zotero_joplin_binder/binder.py new file mode 100644 index 0000000..167a158 --- /dev/null +++ b/src/zotero_joplin_binder/binder.py @@ -0,0 +1,30 @@ +import smtplib +import requests +import dotenv +import os +import json +import time + +dotenv.load_dotenv() + +mail = os.getenv("MAIL") +password = os.getenv("PASSWORD") +mail1 = os.getenv("ADRESS_1") +mail2 = os.getenv("ADRESS_2") +zotero_key = os.getenv("ZOTERO_API_KEY") +joplin_key = os.getenv("JOPLIN_API_KEY") + + +d = requests.get(f"https://api.zotero.org/groups/2611287/items?key={zotero_key}") +print() + +with open("../../output_shared.json", "w") as outfile: + json.dump(d.json(), outfile) + +current = [] + +while True: + time.sleep(2) + with open("../../output_shared.json", "r") as file: + data = json.load(file) + print(data[0])