From 4acd9d324007fa93a3655d2888f5b25f9ccb7237 Mon Sep 17 00:00:00 2001 From: Someone Date: Fri, 30 Sep 2016 02:06:48 +0200 Subject: [PATCH] iitc uniques stats --- iitc_uniques_ststs.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 iitc_uniques_ststs.py diff --git a/iitc_uniques_ststs.py b/iitc_uniques_ststs.py new file mode 100755 index 0000000..651b8da --- /dev/null +++ b/iitc_uniques_ststs.py @@ -0,0 +1,24 @@ +#!/usr/bin/env python3 + +import sqlite3 +import json + +db = sqlite3.connect(".config/chromium/Default/Local Storage/https_ingress.com_0.localstorage") +c = db.cursor() +c.execute('select value from ItemTable where key="plugin-uniques-data"') +row = c.fetchone()[0] + +data = json.loads(row.decode('utf-16le')) + + +visited = {k: v for k, v in data.items() if v['visited'] } +captured = {k: v for k, v in data.items() if v['captured'] } +print("portals: "+str(len(data))+" - visited: "+str(len(visited))+" - captured: "+str(len(captured))) + +print("WTF: portals") +wtf = {k: v for k, v in data.items() if not v['visited'] } +print(json.dumps(wtf)) + +print("del: ") +for k, v in wtf.items(): + print('j=JSON.parse(localStorage[\\"plugin-uniques-data\\"]);delete j[\\"'+k+'\\"];localStorage[\\"plugin-uniques-data\\"]=JSON.stringify(j);') -- 2.43.0