Just a SearchLink fix
I noticed last week as I was working on show notes for Overtired #238 that SearchLink was returning raw search urls instead of the results I expected. I didn’t have time to look at it until this weekend, so I finished the show notes jumping back and forth between my editor and my web browser, like some kind of primitive beast. I think I have it sorted now, though, and I just published version 2.2.17 which should fix the issue. Download below or visit the project page.
If you have no idea what I’m talking about but do any writing for the web, do yourself a favor and check it out. I even made some tutorials for you. Out of all the tools I’ve created, it’s among my most loved. Like top three. Maybe top two. I’ll be honest, it might just be my favorite1.
Generate Markdown links from web searches without leaving your editor.
Updated 03/15/23. Changelog
If you’re curious: something changed in the way DuckDuckGo’s nginx server responds to header requests, so the
location: line wasn’t showing up in a
curl request. Which is baffling. It threw a
curl: (3) URL using bad/illegal format or missing URL error every time I tried to
curl -SsLI (follow redirects and return headers), yet would redirect properly if I left the
-I (return just response headers) out. So now SearchLink is doing a full download of the destination page just to get the location headers, but it works.
(Hopefully someday there will be a search engine with an actual API that doesn’t require all of this hacking. Google used to have one but they canned it years ago and made scraping impossible. DuckDuckGo puts up with scraping, for now, but I really do hope they offer an actual search API someday, like they do with Instant Answers.)
Side Note: Pinboard Searches
Since we’re talking SearchLink, I’d like to point out a feature I added a while back but hadn’t used all that much until recently. If you add your Pinboard API key in the config file, you can search your Pinboard bookmarks and insert the URL for the top match with the
!pb search type. I’ve been using this more as of late because Hook can now create a private Pinboard bookmark every time you hook a web page (or even just copy a Hook link). So now any time I hook a page that I know will be of interest in the future, it’s readily available to my SearchLink searches, offering a nice, finite set of possibilities that all but guarantees I’ll get the URL I was hoping for.