xwmx / nb

CLI and local web plain text note‑taking, bookmarking, and archiving with linking, tagging, filtering, search, Git versioning & syncing, Pandoc conversion, + more, in a single portable script.
https://xwmx.github.io/nb
GNU Affero General Public License v3.0
6.64k stars 188 forks source link

how can import bookmark.html #218

Open newyorkthink opened 1 year ago

newyorkthink commented 1 year ago

I export my chrome bookmark.html

and i import nb.

it not show image

sysrace commented 1 year ago

You may want to check this project https://github.com/jarun/buku once you import the bookmarks into it, or pull the bookmarks straight from the Chrome browser (use --ai parameter). Than you can export it in .md format, or single file using -p -f 10 or just make a simple script and shove it into nb bookmarks add in a cycle.

I have a script "addbookmark" which looks like this, which is adding my bookmarks into nb and buku, because the bookmark search in nb is not ideal. My script is lame, and looks roughly like this (tweak it for your needs), but does the job and you can use same tags in one command.

#!/usr/bin/env bash

if [ "$1" != "" ]; then
  if [ "$2" != "" ]; then
    nb bookmark add "$1" --tags "$2"
    buku -a "$1" "$2"
  else:
    nb bookmark add "$1"
    buku -a "$1"
  fi
else
  exit 1
fi

./addbookmarks http://example.com "my, custom, tags"

1837456 commented 1 year ago

I have also used Buku to import my Firefox bookmarks and then exported it via Buku in .md format. After that I cleaned up that file with vim to get a file with one url per line and then used a simple bash one liner to import all bookmarks into nb:

while read line; do nb $line; done < buku-export.md

That took roughly an hour for round about 1200 bookmarks.