Last active
February 11, 2021 07:16
-
-
Save WWelna/57f2b05695f42e9a513babb2a0b84a2d to your computer and use it in GitHub Desktop.
Dump Gab posts by date
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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