Skip to content

Instantly share code, notes, and snippets.

@WWelna
Last active February 11, 2021 07:16
Show Gist options
  • Save WWelna/57f2b05695f42e9a513babb2a0b84a2d to your computer and use it in GitHub Desktop.
Save WWelna/57f2b05695f42e9a513babb2a0b84a2d to your computer and use it in GitHub Desktop.
Dump Gab posts by date
#!/bin/python3
import orjson
from datetime import datetime
strp = "%Y-%m-%dT%H:%M:%S+00:00"
with open("gab_posts.json", 'r') as f:
for line in f:
j = orjson.loads(line)
d = datetime.strptime(j['created_at'], strp)
with open('bydate/{}.json'.format(d.strftime("%Y-%m-%d")), 'a+') as o:
o.write(line)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment