Skip to content

Instantly share code, notes, and snippets.

@stuart-warren
Last active December 27, 2019 15:59
Show Gist options
  • Select an option

  • Save stuart-warren/b6d7cdd0d5addf841d415a91147c98e8 to your computer and use it in GitHub Desktop.

Select an option

Save stuart-warren/b6d7cdd0d5addf841d415a91147c98e8 to your computer and use it in GitHub Desktop.
chrome history fetcher
#!/bin/sh
# requires sqlite3 with json1 compiled in
# `brew edit sqlite3` add '--with-json1' to install args
# `brew reinstall sqlite3 -s`
h=$(mktemp)
cp -f "$HOME/Library/Application Support/Google/Chrome/Default/History" "$h"
sqlite3 "$h" "SELECT json_object('url', url, 'title', title) from urls where last_visit_time/1000000-11644473600 between strftime('%s','now')-86400 and strftime('%s','now') order by last_visit_time desc;" | jq -s '.' | less
rm -f "$h"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment