From ee12b03b8af5117f1561a6c2787e66b996c0d7da Mon Sep 17 00:00:00 2001 From: LasseMempel Date: Tue, 30 Jul 2024 16:53:48 +0200 Subject: [PATCH] first commit --- poddify.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 poddify.py diff --git a/poddify.py b/poddify.py new file mode 100644 index 0000000..ede9634 --- /dev/null +++ b/poddify.py @@ -0,0 +1,20 @@ +import requests +from solid.auth import Auth +from solid.solid_api import SolidAPI + +api = SolidAPI() +POD_ENDPOINT = "https://restaurierungsvokabular.solidweb.org/" # Pod to demostrate. Replace it with yours. +folder_name = 'wuerste' +file_name = "krakauer.ttl" + +data = " ." +print(api.item_exists(POD_ENDPOINT+folder_name+"/")) +print(api.put_file(POD_ENDPOINT+folder_name+"/"+file_name, data, 'text/turtle')) +# add a new tripe to file +data = " ." +print(api.put_file(POD_ENDPOINT+folder_name+"/"+file_name, requests.get(POD_ENDPOINT+folder_name+"/"+file_name).text + data, 'text/turtle')) +data = " ." +print(api.post_item(POD_ENDPOINT+folder_name+"/", "newfile.ttl", data, 'text/turtle')) + + +# https://restaurierungsvokabular.solidweb.org/wuerste/krakauer.ttl \ No newline at end of file