From 99532dda1bbf346bc0e25a6b07e9b9227c760954 Mon Sep 17 00:00:00 2001 From: Oleg Silkin Date: Wed, 16 Oct 2019 17:01:20 -0400 Subject: [PATCH] Adds script to display comments and the name of the claim they're on --- scripts/display_comments_on_claims.py | 29 +++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 scripts/display_comments_on_claims.py diff --git a/scripts/display_comments_on_claims.py b/scripts/display_comments_on_claims.py new file mode 100644 index 0000000..5d40365 --- /dev/null +++ b/scripts/display_comments_on_claims.py @@ -0,0 +1,29 @@ +import json + +if __name__ == '__main__': + with open('comments_on_claims.json', 'r') as fp: + claims = json.load(fp) + + for claim in claims.values(): + if claim: + print('\n' + claim['name']) + comment: dict = {} + for comment in claim['comments']: + output = f"\t{comment['channel_name']}: " + comment: str = comment['comment'] + slices = comment.split('\n') + for i, slice in enumerate(slices): + if len(slice) > 120: + if '\n' not in comment and len(comment) > 120: + parts = [] + for i in range(0, len(comment), 120): + + + + else: + output += comment.replace('\n', '\n\t\t') + output += '\n' + + print(output) + + print('_'*256 + '\n')