Skip to content

Instantly share code, notes, and snippets.

@markstos
Forked from rudism/qutebrowser-pinboard.sh
Last active August 29, 2020 20:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save markstos/65310a449e606d9a6112606556802301 to your computer and use it in GitHub Desktop.
Save markstos/65310a449e606d9a6112606556802301 to your computer and use it in GitHub Desktop.
Qutebrowser userscript to add current page to Pinboard.in bookmarks (requires Fish shell and httpie as dependencies)
#!/usr/bin/fish
# Uncomment and add your pinboard token here or export it globally somewhere
# PINBOARD_API_TOKEN="username:token"
# Put this file in ~/.local/share/qutebrowser/userscripts and chmod +x
# Run it from Qutebrowser with :spawn --userscript pinboard-add.fish
# Bind it to "A" key with :bind --mode normal A spawn --userscript pinboard-add.fish
# All this does is set PINBOARD_API_TOKEN
source ~/.local/share/pinboard-api-key.sh
set API_HOST "https://api.pinboard.in/v1"
echo "message-info \"Pinboard - Saving: $QUTE_URL\"" >> $QUTE_FIFO
set result ( http -b GET "$API_HOST/posts/add" \
auth_token==$PINBOARD_API_TOKEN \
url=="$QUTE_URL" \
description=="$QUTE_TITLE" \
| grep result
)
echo "message-info \"Pinboard - $result" >> $QUTE_FIFO
# After posting it to pinboard, vist the site so you can edit it.
echo "open -t https://pinboard.in" >> $QUTE_FIFO
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment