add dumping support

This commit is contained in:
nebula 2025-04-20 20:12:34 +00:00
parent f89a3d8601
commit 825d912e7c

6
bink
View File

@ -5,6 +5,7 @@ from glob import glob
from time import time_ns
import os
from collections import OrderedDict
from sys import argv
home = os.path.expanduser("~/.bink")
my_user = home.split("/")[2]
@ -51,3 +52,8 @@ def create_post(title, body):
}
with open(f"{home}/{time_ns()}", "w") as f:
json.dump(thread, f, indent=2)
if "dump" in argv:
with open("/dev/stdout", "w") as f:
json.dump(generate_feed(), f)
exit()