I experimented over the weekend with my new watercolour set, and received some helpful advice from Dave and Erin which guided me toward more-water-less-paint. Watercolour seems to be more a matter of suggestion than traditional “colouring in” as I was used to from childhood. I botched the front vestibule, and the driveway angle’s all wrong, but I like the way this developed.
It’s remarkable how little the tools we’ve created for ourselves to write for the web have evolved: when I wrote the first post here in 1999, I didn’t have a CMS, or a WYSIWYG editor, but otherwise it was as it is.
Of late, I’ve been watching the patterns I go through when I write here, and I decided that it would be a good idea to leverage the fact that I can code to build some prosthetic devices for my writing.
First up: an easier workflow for referencing posts from the past.
Here’s the story: I’m writing along, and I want to, say, mention Bird, a restaurant that Oliver and I went to in Osaka.
Heretofore my pattern would be:
- Open up a new browser tab.
- Go to https://ruk.ca/
- Scroll down to the bottom so I can enter a search term.
- Enter the search term, and click Search.
- Find the post I’m looking for.
- Copy the URL of the post to the clipboard.
- Paste the URL into my new post.
Here’s what I built to replace this.
A Drupal View to Return JSON Search Results
First, I built a Drupal View that returns JSON of up to 10 posts that match the keywords I pass; the search is the same Apache Solr search that the human-facing search uses.
So, for example, this URL returns posts matching keywords truck bird:
https://ruk.ca/search-json?keyword=truck+osaka
Here’s what it returns:
{
"nodes": [
{
"node": {
"label": "TRUCK and Bird in Osaka",
"path_alias": "https:\/\/ruk.ca\/content\/truck-and-bird-osaka"
}
},
{
"node": {
"label": "\"Getting lost gracefully is a form of art...\"",
"path_alias": "https:\/\/ruk.ca\/content\/getting-lost-gracefully-form-art"
}
}
]
}
The View leverages the Apache Solr Search module, the Apache Solr Views integration module, and the Views Datasource module, and it’s really simple (here’s an export of the View if you want to experiment):
An Alfred Workflow
Now that I had a way of getting search results as JSON, I built a workflow for Alfred.app to give me a quick way of getting at them.
The workflow allows me to trigger Alfred (with Control + Space) and then to enter rp followed by my search keywords.
The input script filter looks like this in Alfred’s workflow editor (here’s the PHP):
The workflow’s PHP script simply accepts the keywords it receives from Alfred, passes them to my Drupal View, and passes back the results–titles and paths–to Alfred. In operation, it looks like this:
When I press ENTER on one of those search results (or use the keyboard shortcut that Alfred provides for each), the path gets copied to the clipboard, and I paste it into my post.
Like this:
One of my favourite places to eat is at Bird, an out of the way eatery in Osaka that Oliver and I took a long and winding road to find.
While it took a little bit to stitch together the various parts to make this all work, it’s a productivity-enhancing aid to my writing here, and time well-spent, I think.
Here’s a photo that a friend helpfully sent along of me chatting with Chris Francis, of Receiver Coffee renown, at the Nine Yards Studio party on Friday night:
Chris is the dramatically more fashionable of the two of us, and seeing such a stark contrast prompts me to ruminate on:
- Why didn’t I take my coat off at the party? It was hot up there. I should have taken my coat off.
- Those jeans. I have to throw them away. Trousers should fit. Those don’t.
- Those Rieker sneakers. They’re less than a month old, and yet they’re deteriorating and look like my lawn-mowing shoes. Also, they do not make me look like Steve Jobs as I imagined they did. It’s time to head in a new shoe direction.
- I still like that Marimekko bag all these years later.
- I don’t look like as much of a dork holding a cocktail as I thought I might.
By far and away the most exciting part of the Province House resuscitation is the impending construction of an “exoskeleton” that will enshroud the entire building, Iron Man-style. Preparations continue: this week they’ve dug out a trench around the eastern side.
After several weeks of coveting, I overcame my fears (“we’re going to have to see some artist ID…”) and invested in a Winsor & Newton “Sketchers’ Pocket Box” at The Bookmark.
I haven’t painted with watercolours since kindergarten; they are lovely.
My friend Silva’s new enterprise, Nine Yards Studio, had its launch party tonight, in the space otherwise known as “that place where the bike shop used to be beside where Sam the Record Man used to be.” It was the perfect place to launch a creativity factory.
In an unusual move for me, after decamping for home to carry out parenting duties, I returned for a second go. I’ve never returned for a second go.
Between the time I left, and the time I returned, the mean age dropped 25 years. And as the hour wore on, and even those who Susan Brown called my “age appropriate” familiars left, I was left to silently observe the pulsing of the city’s young creative class. Who knew.
It was an oddly comforting millieu to be immersed in, as I realized that there was no point feeling ill at ease, as the youngsters could not actually see me.
After a feed of oysters and a few more songs from the band, I bundled back into my rain slicker and headed back into the hurricane-like weather for the walk home.
I look forward to seeing what Nine Yards cooks up next.
I’m certain this is just a robotic ad-served-mediated coincidence, but this big ad for Orange is the New Black running on the front page of the very-orange Guardian is perhaps the only time the orange revolution at the paper has made any sense.
I asked The Bookmark to consider ordering some Paper-Oh sketchbooks. And they did, arriving today. So I bought most of the crop.
There are still a couple of A4-size Circulo in stock if you’re in the market.