From 5f5ee8766189361fe12666429f1f0524604debd1 Mon Sep 17 00:00:00 2001 From: Beppe Vanrolleghem Date: Tue, 13 Nov 2018 13:15:11 +0100 Subject: [PATCH] yup --- yt/fixcomments.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 yt/fixcomments.py diff --git a/yt/fixcomments.py b/yt/fixcomments.py new file mode 100644 index 0000000..f4e77ae --- /dev/null +++ b/yt/fixcomments.py @@ -0,0 +1,13 @@ +import json + + +with open('comments-AKLrKMz-avE.json', 'r') as infile: + j = json.load(infile) + +for item in j: + try: + if (item["commentText"]): + temp = item["commentText"] + print(temp.replace("\n", " ").replace("\r", " ")) + except KeyError: + print("wss een comment reply")