Skip to content

Instantly share code, notes, and snippets.

@f440
Created October 4, 2012 16:10
Show Gist options
  • Save f440/3834653 to your computer and use it in GitHub Desktop.
Save f440/3834653 to your computer and use it in GitHub Desktop.
# -*- sh -*-
# [pbl](https://github.com/glidenote/pbl)
# A command line tool for Pinboard to search your bookmarks.
# [zaw](https://github.com/zsh-users/zaw)
# zsh anything.el-like widget.
function zaw-src-pbl() {
local username=$(ruby -rpit -e 'puts Pit.get(:pinboard)[:username]')
local password=$(ruby -rpit -e 'puts Pit.get(:pinboard)[:password]')
candidates=("${(ps:\n:)$(curl -s https://$username:[email protected]/v1/tags/get | grep tag= | sed -Ee 's/.*tag=\"(.*)\".*/\1/')}")
actions=("zaw-callback-pbl-append-to-buffer")
act_descriptions=("pinboard tag search" "append to edit buffer")
}
zaw-register-src -n pbl zaw-src-pbl
function zaw-callback-pbl-append-to-buffer() {
BUFFER="pbl $1"
zle accept-line
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment