I’ve published a few updates to SearchLink since we last talked, some bigger than others. Here’s a rundown of what’s new.
URL Shortening
First, I added more built-in URL shortening. In addition to Bit.ly shortening, you can now use is.gd or TinyUrl. Bit.ly and TinyURL require an API key, so see the configuration for details on that. The is.gd shortener doesn’t require any configuration and might be the obvious choice if you don’t need analytics or other features.
The new searches include !tiny and !isgd, to which you can pass a long url, or you can pass search terms and just have the result shortened. It sure would be nice if you could verify the URL before it was shortened and unrecognizable, though, right? Keep reading.
bang keyword
shortener
!bl / !bitly
Bit.ly
!isgd
is.gd
!tiny
TinyURL
In addition to the url shortener bang searches, you can also shorten any result by appending an underscore and a letter (b, i, or t), for example, !a_i otherworld m4 would search Amazon and then shorten the resulting URL with is.gd. It’s probably more useful to intentionally shorten results, but as you’ll see below, you can confirm a search result and shorten it all in one step now.
By the way, if you use Bit.ly shortening with an Amazon search, it will create an amzn.to URL for you instead of a Bit.ly URL. This is apparently just a thing Bit.ly does. I’ve tried to figure out how to create those for a long time, and then boom, it just happened for me.
bang modifier
shortener
!a_b
Amazon → Bit.ly (amzn.to/3FLCC78)
!g_i
Google → is.gd (bit.ly/3uEzRKE)
!popw_t
Popup Wikipedia → TinyURL (tinyurl.ph/jkRkV)
Setapp Searches
Setapp searching originally started as a [plugin], but I decided to build it into the default search set. Using !set with an app name will give you the Setapp URL for that app. You can configure an affiliate string that will be appended to any Setapp URL automatically.
If the app name passed doesn’t match a valid Setapp URL, a few permutations of the search term are attempted, e.g. removing version numbers (“Marked 2” => “Marked”, “CleanShot X” => “CleanShot”) and adjusting spacing.
Use !set_b or !set_i to shorten the resulting URLs.
Query Parameters
With a lot of custom searches, you might want to apply query parameters such as Google Analytics tracking information or ref=. This would be most useful on custom searches that link to your own sites, for gathering tracking and other information. Now you can add ?key=value arguments to a custom search (or any search, really).
You can use multiple ?key=value arguments on a search — as many as you need. When running a search, you can add additional queries, or you can override the default settings by just offering a different value, e.g. !bt searchlink ?ref=mastodon.
Popup Searches
The whole point of SearchLink is to avoid switching to your browser when adding links to a post, show notes, etc. But sometimes you need a browser to refine a search or verify that the link is going where you want it to go. So I added Popup Searches.
Popup Searches load an Automator web preview with a search engine. You can enter search terms and follow links. Once the link you desire is loaded in the popup browser, hitting “Ok” will insert that link into your text.
The built in engines include:
bang keyword
search engine
!pop
DuckDuckGo
!popa
Amazon
!popg
Google
!popw
WikiPedia
If you include a search term with any of these keywords, the search engine will be pre-populated with the search and you can just select the result you want. You can always alter the search from within the popup browser.
The Popup Searches require the Preview URL Service, which is now included in the distribution. If you’re running from the command line, it will be automatically included in the Gem library, but if you are, like most people, using SearchLink as a Service, you’ll need to install the Preview URL Service found inside the downloaded SearchLink archive.
Popup Searches work with the _b type shorteners as well.
Confirming and Previewing Results
Especially in cases where you’re running a URL shortener, it’s really nice to be able to view and confirm the search result before the link is shortened, as once it’s shortened the only way to verify it goes to the right place is to open it, defeating the purpose of SearchLink. So I added confirmation dialogs.
If you’re running a shortener, either from a !isgd type bang search, or with the _i type modifier, a confirmation will be required before the link is shortened. If you have the Preview URL Service installed, the confirmation dialog will have an additional “Preview” button, which will load the search result in the popup browser. If you select “OK” from the popup browser, the URL will be used unchanged. If you follow a link in the popup browser, when you hit “OK,” the new URL you navigated to will be used instead.
If the Preview URL Service isn’t installed, you’ll just get a dialog with “OK” and “Cancel” buttons.
What this means for the URL shorteners is that you can actually see the URL, preview it, and even modify it before the shortening happens. Any search run with a URL shortener will automatically go through this confirmation process.
You can force this type of confirmation on all search results by adding confirm: true to your configuration. But if you just want to confirm certain searches, you can use the --confirm flag on the search (or custom search configuration). This can be shortened to just ++c, or if you have confirmation enabled for all links, you can avoid it on a specific link or custom search by using --c or --no-confirm.
Image Searching
SearchLink already had some image search plugins, but most of them were broken and I hadn’t realized it. You can once again use !img search term to get the first result for an image search, inserting a Markdown  link.
If the end result from a Popup Search happens to be a recognizable image format, then the link output will automatically be formatted as an image instead of a regular link.
Goodbye, Jump to Error
The Jump to SearchLink Error Service has been removed for now. It wasn’t functioning properly and in the process of fixing it I found that sending keystrokes from a Service had grown significantly more difficult. I’m still working on a means to implement this. In reality I hardly ever use it anyway, so it’s not top on my priority list.
New Plugins
Also be sure to check out the newest plugins, including some for shortening Amazon URLs and expanding shortened URLs using StretchLink. I’ve only received a couple contributions of user plugins, so if you do make one, please share!
That’s the latest and greatest. As I say all the time, of all my creations, I consider SearchLink one of the most useful in my day-to-day life. From whipping up podcast show notes to writing a post like this one, the ability to include links and attributions without switching to my browser is a real boon.
Download below (includes the Preview URL Service), and check out the SearchLink project and wiki for details and documentation!