mirror of
https://github.com/one-among-us/data.git
synced 2024-11-23 03:27:38 +08:00
[+] Add export script
This commit is contained in:
parent
1f9f1cfa93
commit
1aca03a09e
1
people/tdor/comments/.gitignore
vendored
Normal file
1
people/tdor/comments/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
export.md
|
19
people/tdor/comments/export.py
Normal file
19
people/tdor/comments/export.py
Normal file
@ -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()
|
Loading…
Reference in New Issue
Block a user