Skip to content

Commit

Permalink
[+] Add export script
Browse files Browse the repository at this point in the history
LS-KR committed Nov 22, 2024
1 parent 1f9f1cf commit 1aca03a
Showing 2 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions people/tdor/comments/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export.md
19 changes: 19 additions & 0 deletions people/tdor/comments/export.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import os
import json

md = ''

for dirpath, dirName, fileName in os.walk("./"):
for f in fileName:
if f.lower().endswith('.json'):
with open('./' + f, 'r') as file:
data = json.load(file)
md += str(data['content']).replace('\n', ' \n').replace('\\n', '\n\n')
md += '\n\n'
md += '——' + str(data['submitter'])
md += '<br /><br /><br /><br />\n\n'

print(md)
m = open('./export.md', 'w')
m.write(md)
m.close()

0 comments on commit 1aca03a

Please sign in to comment.