Keyword Search in iOS App Store

Follow Up on Keyword Search Extension and Static Sites

Two weeks ago I told you about the nifty plugin for Safari called Keyword Search. This is the one that allows you to set up little shortcuts to search sites you visit often. I explained that it works really swell with most sites, but not with static sites like Programming By Stealth. PBS is a static site created by simple Markdown files inside a GitHub repository. Bart and I eat our own dog food for the podcast and it keeps managing the information much simpler for Bart.

I went on to explain that I figured out a workaround by adding in a text replacement shortcut in the Keyboard Preference Pane. I was chatting with Bart about it and he came up with a better idea. It’s still a little bit of a workaround because Keyword Search still won’t take you right to the PBS site, but it does have a big advantage over my idea.

By using the Keyboard Preference Pane to create a Text Replacement, I have to maintain that one website search in a completely different tool, which adds cognitive load to my brain which is overloaded on my best day. His alternative will allow me to keep all of my keyword searches in the same tool.

While can’t do search queries, Google or whatever search engine you favor can search the PBS pages, and it can create that query string we need. It was a little more complicated than I expected but still pretty easy to do. To search the PBS pages (or any site) using your search engine of choice, simply type the search term followed by “”.

Using Google as the example, if I could find out the query string that Google uses for that search, I could put it into the Keyword Search extension with a placeholder.

I typed “module” into Google, and it dutifully returned a set of results. I looked at the URL bar, but sadly it just said “module”, not the search query it used. I started writing a message to Bart about how it wasn’t going to work. I selected all in the URL bar (again that’s just “module”) but when I pasted it into the message, it was the real search query after all! It was extraordinarily long with lots of glop in it:

But I looked at the beginning and realized it was really pretty simple. The beginning said:

Buried in that I could see the key/value pair “q=module” which is what I searched for. The final step then was to substitute in the placeholder “@@@” for the word “module” and I have my search query ready to plop into the Keyword Search extension.[email protected]

If you’d like to be able to search static sites with Keyword Search, or if you prefer seeing your keyword searches inside Google’s interface, just copy this string from my notes and plop it into your own extension. My Keyboard Text Replacement achieved the same result, but keeping track of it in one place is going to be easier. Plus I learned that if I can’t find the search box on a given site, or I’m too lazy to do the legwork, I can always copy this search query and adapt it for any site I like. Best of all worlds!

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to top