From 83bb46116eac23134c5d5bfa88b4d7ae6a403b8f Mon Sep 17 00:00:00 2001 From: Markus Birth Date: Sat, 1 Oct 2022 20:51:17 +0200 Subject: [PATCH] Put input-/ouput file into variables. --- walla2goodlinks.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/walla2goodlinks.py b/walla2goodlinks.py index d0ce3b8..67dcbb5 100755 --- a/walla2goodlinks.py +++ b/walla2goodlinks.py @@ -5,10 +5,13 @@ import json import re from datetime import datetime +WALLABAG_EXPORT = "Wallabag All articles.json" +OUTPUT_FILE = "walla2goodlinks.json" + # https://stackoverflow.com/questions/9662346/python-code-to-remove-html-tags-from-a-string CLEANR = re.compile(r"<.*?>") -with open("Wallabag All articles.json", "rt") as f: +with open(WALLABAG_EXPORT, "rt") as f: json_obj = json.load(f) output_obj = [] @@ -33,5 +36,5 @@ for rec in json_obj: print(repr(new_obj)) output_obj.append(new_obj) -with open("walla2goodlinks.json", "w") as f: +with open(OUTPUT_FILE, "w") as f: json.dump(output_obj, f)