Created
March 3, 2021 16:50
-
-
Save WWelna/d07e9a3eb7f2d64f04f8fbcb14912aa4 to your computer and use it in GitHub Desktop.
DDoSecrets - Gab Stats - Posts per Day
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 as json | |
from datetime import datetime | |
import dateutil.parser | |
import collections | |
dates = {} | |
with open('/xs/Archive-Gab/ddosecrets_gabdump.json') as f: | |
for line in f: | |
try: | |
j = json.loads(line) | |
if j['__DBEXPORT__'] == 'statuses': | |
j2 = json.loads(j['data']) | |
d = dateutil.parser.isoparse(j2['created_at']) | |
ds = d.strftime('%Y-%m-%d') | |
if ds in dates: | |
dates[ds] += 1 | |
else: | |
dates.update({ds:1}) | |
except: pass | |
k = sorted(dates.keys()) | |
r = collections.OrderedDict() | |
for e in k: | |
r.update({e:dates[e]}) | |
print(json.dumps(r).decode('utf-8')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment