Skip to content

Instantly share code, notes, and snippets.

@stratosgear
Created April 21, 2015 21:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save stratosgear/298c61cf3decf8e62caf to your computer and use it in GitHub Desktop.
Save stratosgear/298c61cf3decf8e62caf to your computer and use it in GitHub Desktop.
Nicely display Google history
#!/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'])
@stratosgear
Copy link
Author

Better viewer of the json files that you download from Google Search.

(according to http://venturebeat.com/2015/04/20/google-now-lets-you-export-your-search-history/)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment