Leander is a command line HTML clipping utility written in Ruby.
I wrote this to replace my old method of bookmarking - "xclip -o | perl -pi -e 's:$:\n\n:g' >> ~/.bookmarks".
This provides a nicer way to search for links and get some context when the time comes to retrieve one.
I've tested this with ruby 1.8.7 (and now 1.9.1) on Arch Linux. I offer no guarantees to its performance. The simplest way to install is probably 'gem install leander', although that may be flakey.
usage: leander 'query' OR leander query bookmarks or store a bookmark from URL on STDIN
specific options -d, --delete deletes all documents matching the given query from the index --show-html print out the HTML stored for each URL provided --hide-url hide URL : useful with --show-html to pipe output to a browser -h, --help Show this message
I use Xmonad, and I use leander like this:
((modMask .|. shiftMask, xK_t), spawn "xclip -o | leander")
Combined with Vimperator's 'yy' command to yank the current URL, it's pretty slick.
leander features a sinatra-based server component
# leander-server&
# curl https://localhost:4567/search/leander
<p class='results'>
<p>rudle's leander at master - GitHub</p><a href="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/rudle/leander">
https://github.com/rudle/leander
</a>
</p>
# curl https://localhost:4567/api/search/leander
{"0":{"result":{"url":"https://github.com/rudle/leander\n","title":"rudle's leander at master - GitHub"}}}
We can also write a new bookmark using /write/https://domain.tld