]> git.somenet.org - pub/jan/scripts.git/blob - iitc_uniques_ststs.py
intress autorecharger fixed convert usage of srgba
[pub/jan/scripts.git] / iitc_uniques_ststs.py
1 #!/usr/bin/env python3
2
3 import sqlite3
4 import json
5
6 db = sqlite3.connect(".config/chromium/Default/Local Storage/https_ingress.com_0.localstorage")
7 c = db.cursor()
8 c.execute('select value from ItemTable where key="plugin-uniques-data"')
9 row = c.fetchone()[0]
10
11 data = json.loads(row.decode('utf-16le'))
12
13
14 visited = {k: v for k, v in data.items() if v['visited'] }
15 captured = {k: v for k, v in data.items() if v['captured'] }
16 print("portals: "+str(len(data))+" - visited: "+str(len(visited))+" - captured: "+str(len(captured)))
17
18 print("WTF: portals")
19 wtf = {k: v for k, v in data.items() if not v['visited'] }
20 print(json.dumps(wtf))
21
22 print("del: ")
23 for k, v in wtf.items():
24   print('j=JSON.parse(localStorage[\\"plugin-uniques-data\\"]);delete j[\\"'+k+'\\"];localStorage[\\"plugin-uniques-data\\"]=JSON.stringify(j);')