-
-
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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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