Saves Pinboard bookmarks as local webloc files on a Mac. Can add thumbnails and save PDF's, with external apps. Works with Tags.app or the OpenMeta cli utility.
Update [April 3rd, 2011]: The current version, 1.0.4 at the moment, has bugfixes for running without Tags.app installed, more error handling and a new setting for locations where the date format is dd-mm-yyy
. If you had a previous version and run into trouble, please replace the script with the latest and delete your ~/getpinboard.yaml
file to regenerate a new one with the additional localization setting.
This script is for people who want to take advantage of Pinboard–with its full text search, easy privacy settings, accessible API, etc.–yet still want to be able to search their bookmarks in local Spotlight (and similar) searches. While it has the option to save bookmarks with a certain tag as searchable PDF files, it doesn’t attempt to replicate the full spectrum of Pinboard features. It’s just a way to make your remote bookmarks locally searchable, available system-wide and OpenMeta compatible.
I toyed around for a long time with using safaribookmark files instead of webloc files. They let you store a larger preview image, and you can include full text from websites within the XML of the file. Lots of possibilities there. For many reasons, I decided to stick with these little webloc files. If I want fancier images and web text, I’ll use Webbla, and if I want comprehensive full text search I’ll use HistoryHound, both excellent programs in their own right. I want OpenMeta and simplicity, though. If I know I’m looking for a bookmark from Pinboard, I can just go to Delibar and do some searching. The goal is to be able to include my web discoveries in larger searches on my Mac.
First, put the script somewhere you can leave it, preferably somewhere in your system path. That’s not a huge deal, though, because you’ll be supplying an absolute path in most automation cases anyway. Once you have it situated, open Terminal and run chmod a+x /path/to/your/script.rb
. Now you can run the script from the command line to configure and test.
When you run the script the first time (do it from the command line with /path/to/script/getpinboard.rb
), it puts a configuration file at ~/getpinboard.yaml
. It will let you know exactly where it is, and will automatically open it in your text editor. You must edit the configuration settings before you’re ready to run it again. The configuration has options for all of the main features of the script, so these instructions are also going to be the tour. You can edit any of these options at any time. Note that the next time you run the script it will pull in up to 500 of your bookmarks, starting with the oldest. If you decide you didn’t like a setting, you may want to trash those files and the database and start over. Try not to let that happen.
mm-dd-yyyy
. Set it to ‘UK’ if your date format is dd-mm-yyyy
.~/Library/Caches/Metadata/Tags/Bookmark
folder (where Tags.app stores its tagged bookmarks) symlinked to ~/Dropbox/Sync/Bookmark
. That Dropbox folder is my target for the script, so I’m saving my Pinboard bookmarks to my Tags folder and still syncing them (and their OpenMeta tags) to my other computers. Further Tags integration will be covered at the end of the options.bookmarks.stash
, and it’s perfectly fine for it to exist in the same folder as you set for your TARGET./usr/local/bin/setWeblocThumb
.As mentioned above, if you want to create thumbnails for your webloc files from screenshots of the web page, you’ll need setWeblocThumb, a free utility for doing just that. Its functionality is included in the script, just install the utility and make sure thumbnailing is enabled in the config. The script expects the utility to be located at /usr/local/bin/setWeblocThumb
.
If you want the option to save bookmarks with a certain tag as fully-searchable PDF files, you’ll need the latest (I use the term loosely) version of Paparazzi!.
You’ll also probably want Growl installed. I can’t recall if the command line utility growlnotify
is set up by default, but that’s what the script uses to send notifications. It will live if you don’t have it, but it generally won’t try to communicate by any other channels when debugging is turned off.
There are a couple of options for automating the script. You can have it run at regular intervals; it stores its last update time and compares it with the Pinboard server before it bothers downloading anything. Once you’re up-to-date on your sync, you could run it every 15-30 minutes without any trouble. The easiest way to do that is with launchd
, and the easiest way to do that is with Lingon. If you don’t already have it, grab it from the Mac App Store. It’s worth the five bucks. Use the wizard to set up a schedule and run the script.
What I do is set up Hazel to watch the database file for Delibar. Delibar is my favorite app for bookmarking and searching my online bookmarks. It works wonderfully with Pinboard, and I can’t recommend it highly enough. I can hit a key when I’m on a website in any browser and be able to quickly comment, tag and save the page (either privately or publicly) using the same Cocoa interface every time. Anyway, Delibar keeps its database in ~/Library/Application Support/Delibar
and the file is named DelibarDB.xml
. I simply watch for changes since the last match, and then run the script when one is found. I’m sure you could accomplish something similar with Webbla, or even one of the browser plugins if it modified a local store at all when you add the bookmark.
You could resort to cron
, or run it manually once in a while, I suppose. It’s far handier to have it out of mind, though, and just have your bookmarks show up in OpenMeta and Spotlight searches within minutes of bookmarking them.
defaults
command. For the purposes of debugging, it’s sometimes useful to set that back a bit and force it to update. Just use getpinboard.rb -r
to set it back 24 hours, or use a number after the -r to specify a number of days to revert.If you need to uninstall the script, remove it from whatever you’re using to schedule its activity, delete the script and locate two files:
~/getpinboard.yaml
(in your User’s home folder)~/Library/Preferences/com.brettterpstra.PinboardTagger.plist
(in your User’s Library/Preferences folder)Hope the script comes in useful for somebody, feel free to let me know if you have any trouble with it.