From f7a89ec8ee3896c892becd009b3a6e6a7b22c81c Mon Sep 17 00:00:00 2001 From: deniz-znanec Date: Thu, 29 Oct 2020 09:17:25 +0100 Subject: [PATCH 1/2] Create denis-znanec.json Added 10 new quotes --- motivate/data/denis-znanec.json | 43 +++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 motivate/data/denis-znanec.json diff --git a/motivate/data/denis-znanec.json b/motivate/data/denis-znanec.json new file mode 100644 index 00000000..148fb6a7 --- /dev/null +++ b/motivate/data/denis-znanec.json @@ -0,0 +1,43 @@ +{ + "data": [{ + "quote": "Do the best you can. No one can do more than that.", + "author": "John Wooden" + }, + { + "quote": "Don’t Quit", + "author": "Unknown" + }, + { + "quote": "It’s never too late to be what you might’ve been.", + "author": "George Eliot" + }, + { + "quote": "I choose to make the rest of my life, the best of my life.", + "author": "Louise Hay" + }, + { + "quote": "Trust yourself that you can do it and get it.", + "author": "Baz Luhrmann" + }, + { + "quote": "Don’t let what you can’t do interfere with what you can do", + "author": "Unknown" + }, + { + "quote": "You can do anything you set your mind to.", + "author": "Benjamin Franklin" + }, + { + "quote": "All we can do is the best we can do.", + "author": "David Axelrod" + }, + { + "quote": "The world is full of nice people. If you can’t find one, be one.", + "author": "Nishan Panwar" + }, + { + "quote": "Twenty years from now you’ll be more disappointed by the things you did not do than the ones you did.", + "author": "Mark Twain" + } + ] +} \ No newline at end of file From c86bfcbd785179e041d1f27a6f28d07f0302b8c7 Mon Sep 17 00:00:00 2001 From: deniz-znanec Date: Thu, 29 Oct 2020 11:14:45 +0100 Subject: [PATCH 2/2] add utf-8 encoding Add utf_8 encoding --- motivate/find_dupes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/motivate/find_dupes.py b/motivate/find_dupes.py index 4fc1bc92..d8600cdd 100755 --- a/motivate/find_dupes.py +++ b/motivate/find_dupes.py @@ -9,7 +9,7 @@ quotes = [] for f in all_json: filename = os.path.join(data_dir, f) - with open(filename) as json_data: + with open(filename, encoding='utf-8') as json_data: quotes += json.load(json_data)['data'] uniq_authors = {quote['author'] for quote in quotes}