Created
March 10, 2011 20:09
-
-
Save dsanson/864823 to your computer and use it in GitHub Desktop.
dump chrome's history to a text file for use with quicksilver.app
This file contains 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
#!/bin/sh | |
# | |
# export_chrome_history.sh | |
# | |
# A script to dump a list of urls from Google Chrome's History | |
# database on OS X. It should work on any *nix, but you'll need | |
# to edit the values of $input_file and $output_file. | |
# | |
# | |
# Author: David Sanson | |
# URL: https://gist.github.com/864823 | |
# License: [MIT](http://creativecommons.org/licenses/MIT/) | |
# | |
# Dependencies: sqlite3, mktemp, perl | |
# | |
# | |
# Change these values if your History file is somewhere else | |
# or if you want to export the history to somewhere else. | |
input_file="$HOME/Library/Application Support/Google/Chrome/Default/History" | |
output_file="$HOME/Library/Application Support/Google/Chrome/Default/chrome-history.txt" | |
# Use this to keep the size of the history under control | |
n_most_recent=500 | |
# If Chrome.app is open, the History database will be locked. So | |
# we'll make a temporary copy to play with. | |
tmp_history=`mktemp -u "/tmp/export_chrome_history.XXXXX" || exit 1` | |
cp "$input_file" "$tmp_history" | |
sqlite3 "$tmp_history" \ | |
"select url from urls order by last_visit_time desc" \ | |
| head -n $n_most_recent \ | |
> $output_file | |
rm "$tmp_history" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here's a chrome extension I made that does this: https://chrome.google.com/webstore/detail/export-history/hcohnnbbiggngobheobhdipbgmcbelhh