Skip to content

An enhanced version of the Pinboard.in “Add Bookmark” page, which takes advantage of the capabilities of modern browsers

License

Notifications You must be signed in to change notification settings

rossshannon/pincushion

Repository files navigation

Pincushion

Pincushion is an alternative bookmarklet for Pinboard that you can add to your browser, and use to save and edit bookmarks. It is designed to be mobile-friendly, fast and interactive, and harnesses the capabilities of modern browsers to enhance the experience of tagging and saving bookmarks.

Features

  • Smartphone & tablet-optimised Pincushion adapts to the size of your mobile device’s screen, to make reading and editing the form easier, without requiring you to zoom in before you begin. Form elements respond to you as quickly as they would in native mobile apps.
  • Interactive The form is enhanced with animation to guide interaction, and more clearly explain what is happening while you edit and save your bookmarks.
  • Easily add tags Pincushion uses as intelligent autocomplete widget that shows the tags you’ve previously used, along with the number of times you’ve used them. The autocomplete even lets you search within your tags without having to type the exact letters that a tag begins with.
  • Search across all of your tags The first time you use Pincushion, it downloads a local copy of all of your tags into your browser’s “LocalStorage”, which allows you to store about 2.5MB of data and preferences for each site you use regularly. This means that from then on, the autocomplete widget can search across your entire collection.

The autocomplete can use each tag’s score to be smarter about which tags to suggest to you as you are typing. (Tag autocomplete has been tested on a data set of over 12,500 tags, which totalled 184KB when downloaded.)

  • AI-based tag suggestions When bookmarking a new page, the form will suggest tags based on your previous usage, other Pinboard members tags for that same page, as well as optionally using AI to propose relevant tags.

Installing the Bookmarklet

To use the bookmarklet, you will need to have an account on http://pinboard.in. When logged in, visit your password settings page to locate your API token — it will be in the form

username:462E2B102D4CCDE36662

Your API token is a way to grant applications or websites the ability to send bookmarks to your Pinboard account, without having to give them your password.

To add the bookmarklet to your browser, simply add a new bookmark, give it any name you want, and use the following text as the URL:

javascript:q=location.href;d=(window.getSelection?window.getSelection():document.getSelection?document.getSelection():document.selection.createRange().text);p=document.title;void(open('https://rossshannon.github.io/pincushion/?user=USERNAME&token=API_TOKEN&url='+encodeURIComponent(q)+'&description='+encodeURIComponent(d)+'&title='+encodeURIComponent(p),'Pinboard','toolbar=yes,width=600,height=700,left=50,top=50'));

Often the easiest way to do this is to bookmark the page you’re currently reading, and then edit this bookmark and replace the URL with the above code. Replace USERNAME with your Pinboard username, and API_TOKEN with your 20-character API token and you’re all set. Click the bookmarklet and it will open the Pincushion interface.

You can also pre-check the “private” and “to read” checkboxes by passing these properties with the value true:

javascript:q=location.href;d=(window.getSelection?window.getSelection():document.getSelection?document.getSelection():document.selection.createRange().text);p=document.title;void(open('https://rossshannon.github.io/pincushion/?user=USERNAME&token=API_TOKEN&url='+encodeURIComponent(q)+'&description='+encodeURIComponent(d)+'&title='+encodeURIComponent(p)+'&private=true&toread=true','Pinboard','toolbar=yes,width=600,height=700,left=50,top=50'));

You can also enable the AI features by passing in an OpenAI user token as a parameter (openai_token).

javascript:q=location.href;d=(window.getSelection?window.getSelection():document.getSelection?document.getSelection():document.selection.createRange().text);p=document.title;void(open('https://rossshannon.github.io/pincushion/?user=USERNAME&token=API_TOKEN&url='+encodeURIComponent(q)+'&description='+encodeURIComponent(d)+'&title='+encodeURIComponent(p)+'&openai_token=sk-FasOvdWzKZDBlcQ6wONkT3BlbkFIVc9ihRqqBLSrF98ww3yX','Pinboard','toolbar=yes,width=600,height=700,left=50,top=50'));

Browser Support

Pincushion is designed for modern browsers like Chrome, Safari, Firefox, Internet Explorer 10+, and mobile varieties of Safari and Chrome. Earlier versions of Internet Explorer have problems with the cross-domain Ajax required.

Running Locally

  • Clone the repository to your computer. git clone https://github.com/rossshannon/pincushion.git
  • Switch into the new directory and run yarn install or npm install
  • Install the foreman gem using gem install foreman, and then run the Procfile using foreman start -p 5000. Grunt will build the required packages and a web server will be booted to run Pincushion on localhost port 5100 (http://localhost:5100).

Changelog

1.6 (2023-10-18)

  • Add optional AI-based tag suggestions using OpenAI APIs.

1.5 (2023-10-14)

  • Detect URL fragments (hashes) in URLs and give support to remove them if desired, so that canonical URLs are being bookmarked instead of sections of documents.

1.4 (2023-10-08)

  • Revamp build process and dependencies. Improve how tag suggestions are handled.

1.3 (2021-06-14)

  • Added options to set the “private” and “to read” options to true by default via the bookmarklet URL.

1.2 (2017-09-10)

  • Switched to a self-hosted version of the Pinboard API bridge to avoid occasional downtime or slow requests.
  • Updated development dependencies and added instructions for running locally.

1.1 (2016-01-3)

  • Improve tag sorting so that tags that are used more frequently will be sorted higher in the autocomplete list.
  • Allow autocomplete to match tags while ignoring punctuation (for example, typing “theo” will now match “the_onion”).

1.0 (2014-10-04)

  • Local tag storage, autocomplete-based tag suggestions, Pinboard API integration, mobile compatibility, usability improvements and error-handling.

Project started (2014-04-04)

License

Copyright © 2014–2024 Ross Shannon.

Pincushion is open source software, licensed under the MIT License. Suggestions and pull requests are welcome.

Acknowledgements

Pincushion uses a number of excellent open source libraries.

About

An enhanced version of the Pinboard.in “Add Bookmark” page, which takes advantage of the capabilities of modern browsers

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published