به Nostr بپیوندید
2026-08-20 19:17:30 UTC
in reply to

Taylan (GNU+Feminism Cat) on Nostr: Luckily, the instructions seem to be in the code as commends :D ```py import json ...

Luckily, the instructions seem to be in the code as commends :D

```py
import json
import os

# How to use:
# Install Python: https://www.python.org/downloads/
# Create a new folder and put "outbox.json" into it, along with this script.
# You should be able to start the script by double-clicking on it.

try:
os.chdir(os.path.abspath(os.path.dirname(__file__)))

with open('outbox.json', encoding = 'utf8') as f:
data = json.load(f)

i = 0

out = open('Spinster posts.txt', 'w', encoding = 'utf8')

for item in data['orderedItems']:
i += 1
if item['type'] != 'Create':
continue
post = item['object']
date = post['published']
text = False
if 'source' in post:
text = post['source']
elif 'content' in post:
text = post['content']
if text:
out.write('[')
out.write(date)
out.write(']\n')
out.write('\n')
out.write(text)
out.write('\n')
out.write('\n')
out.write('\n')

print("Parsed %d posts." % i)

except Exception as e:
print(e)

input('Press ENTER to exit.')

# End of script
```