Pinboard is a great bookmarking service. I was grandfathered in on the original one-time payment plan, and recently switched to a regular subscription when he politely requested I consider it.
The thing is… I hardly ever use pinboard! Bookmarking just isn’t on my radar these days; that’s what search-engines are for.
What I’ve long wanted though is some sort of serendipity in the service. I don’t often have a problem locating something again if I remember what it was, but I have no idea what I’ve since forgotten about. When I recently realised that it was pretty easy to implement and host, I knew this little project wasn’t far away. In readiness, I’ve tried to be a lot more cavailier about bookmarking anything that seems randomly interesting.
This repository (clone away!) will send you a daily email of 5 random links from your pinboard account.
Fork this repository! It should run as-is, after configuration.
You will need to create the following secrets for the action:
Secret Name | Description |
---|---|
The recipient for this email | |
PINBOARD_TOKEN | Find this on the settings password page. |
API_ENDPOINT | Could be hard-coded, but the upcoming v2 API mentions a test endpoint. https://api.pinboard.in/v1/ |
SMTP_USERNAME | The gmail (hardcoded) email address; may or may not be the same as EMAIL |
SMTP_PASSWORD | The gmail password associated. (May be an application password) |
VENV_CACHEBUSTER | Set to a new value every time the cache expires |
It uses Mako Templates if you need to edit the email output. I built the mine using Maizzle, but obviously you can use whatever you feel like.
It uses the ”all bookmarks” API; note that this is rate-limited so if you are testing you probably want to temporarily change it to ~posts/recent~. There is no pagination for now, because I don’t have that many bookmarks yet.
You have two options when creating the initial PinboardAPI
object; pass it a dictionary with your configuration variables
above (it only needs the first three), or by default it will load
from the environment. I prefer the latter, using direnv (the
.envrc
file is in .gitignore
). It also has Emacs support.
The scheduled action will not run forever without maintenance. The virtualenv will eventually expire from the cache (see the VENV_CACHEBUSTER secret, and also the setting it passes through to). The action itself will be disabled after 60 days of repository inactivity. (There may be other limits I haven’t hit yet!)