Web excursions brought to you in partnership with CleanMyMac X, all the tools to speed up your Mac, in one app.
One of the things I was missing when I switched from WordPress to Jekyll was my “Web Excursions” setup. It allows me to gather link collections for posts as I browse and generate a single post with multiple links rather than a ton of individual “link list” posts”1.
Previously, I had just sent sites I wanted to include to Pinboard with a “blogit” tag and a description that would become the post. A WordPress plugin (Postalicious) would poll my bookmarks hourly and generate a post automatically when I had reached five or more new bookmarks with the given tag.
As a replacement, I created a CLI script that I could run manually, via cron/launchd or during the rake generate
task which builds my static site. It works like this:
- Read in an existing stash of previously retrieved bookmarks
- Retrieve the latest pinboard bookmarks for ‘blogit’ tag
- Compare the new bookmarks to previous stash
- Add new bookmarks to a “draft” stash
- Add the bookmarks in the draft stash into the main bookmarks stash and save it to a file
- If the draft stash has 5 or more bookmarks
- create a draft post
- clear the draft stash
I have a custom draft setup that I’ll detail in a future post, but this basically generates a Web Excursions post in my drafts folder with all the necessary title, tags, categories, etc., and formats the new bookmarks using a Markdown template. I can then use Rake to publish at any time, and it updates the title and publish date to the current time.
If you’re interested in the script, help yourself. I’ve posted it as a Gist. It will eventually end up in a repository of my Jekyll hacks, once I have them all ready to share2.
Edit the various $conf[]
variables to suit your needs. It should be flexible enough to work with any static blogging system, or even with the Blogging Bundle for TextMate.
Note: the first time you run the script it will pull all entries with the configured tag within the latest 100 bookmarks. It will create a draft with all of them and you’ll need to edit or discard that manually. After that it will only bring in new posts since the last run.
-
Link list posts are great for some people, and I’m not against them. They just don’t fit my style. ↩