Skip to content

Instantly share code, notes, and snippets.

@mavit
Created December 5, 2013 17:35
Show Gist options
  • Save mavit/7809777 to your computer and use it in GitHub Desktop.
Save mavit/7809777 to your computer and use it in GitHub Desktop.
Export Chromium bookmarks as CSV
#!/bin/sh
# This is a hack. In real life, never parse JSON with a regular expression. Never write SQL unencoded to a string.
perl -nE 'push @urls, $1 if m/^\s+"url":\s+"(.+?)"/; END { say q[select url, title, visit_count from urls where url in ("], join(q(","), @urls), q[") order by visit_count desc;] }' ~/.config/chromium/Default/Bookmarks | sqlite3 -csv ~/.config/chromium/Default/History
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment