Skip to content

Instantly share code, notes, and snippets.

@guyhughes
Last active September 2, 2017 16:11
Show Gist options
  • Save guyhughes/57ae5bdae1383b2ce147eea1205582c7 to your computer and use it in GitHub Desktop.
Save guyhughes/57ae5bdae1383b2ce147eea1205582c7 to your computer and use it in GitHub Desktop.
# Brave bookmarks extraction is currently broken so this is how to dump them
# into a stream of json objects, then rewrite that into markdown. You can transform the
# markdown into html with pandoc or whatever.
# requires jq and sed
<session-store-1 jq ' .sites | to_entries[] | select(((.value.tags | length > 0) and ([.value.tags[] == "bookmark"] | any ) ) ) | { (.value.title): .value.location } ' > ~/brave-bookmarks.json
sed -r -e '/^[{}]$/d' -e 's/\s*"([^"]*)":\s*"([^"]*)"/[\1](\2)/' ~/brave-bookmarks.json > ~/brave-bookmarks.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment