-
-
Save chsivateja/b62c6bcfc15fc0d70c8e to your computer and use it in GitHub Desktop.
Nicely display Google history
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
#!/usr/bin/python2 | |
import sys | |
import json | |
from datetime import datetime | |
if len(sys.argv) < 2: | |
print "Give me the json file to display!" | |
sys.exit(-1) | |
with open(sys.argv[1], 'r') as jsonFile: | |
searches = json.load(jsonFile) | |
for search in searches['event']: | |
when = datetime.fromtimestamp(int(search['query']['id'][0]['timestamp_usec']) / 1000000) | |
print u'{:%Y-%m-%d %H:%M:%S}: {}'.format(when, search['query']['query_text']) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment