Last active
August 29, 2015 14:21
-
-
Save cat5inthecradle/f4dbed9f37b80e024265 to your computer and use it in GitHub Desktop.
Python Firefox Tab Counter
This file contains hidden or 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
| import json | |
| import os | |
| import glob | |
| from datetime import datetime | |
| appdata = os.getenv('APPDATA') | |
| fi = open(glob.glob(appdata + '/Mozilla/Firefox/Profiles/*.default/sessionstore-backups/recovery.js')[0], "r") | |
| jdata = json.loads(fi.read()) | |
| fi.close() | |
| fo = open('tabcount.csv', 'a') | |
| fo.write(str(datetime.now()) + ", " + str(jdata["windows"][0]["selected"])) | |
| fo.write("\n") | |
| fo.close() |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Running this as a scheduled task every hour for funzies.