Safari search script?

#1

I’m new to automation and would like to create some sort of workflow where I could activate a script to search for book titles among various websites. I can of course use DDG bangs on Amazon or Goodreads, but what I’d like to do is create a script I can invoke to search all of my favorite book reviewer websites at once (Bookworm, James Clear, Derek Sivers, AlexandBooks, etc) to see if any of them have written about whatever productivity/business book I’m currently investigating.

Is there any easy way to doing this? I’ve done a bit of unix shell scripting a decade ago, but it’s been a long while, and I’m not sure if it’s easier to do in Automator or some other GUI tool or not.

Thanks!

0 Likes

#2

The best way to search across multiple sites would rely on each of the sites having some sort of Web API you could hook into. Better still would be if there were one such API that hooked into or used each site. I’m not familiar with all of the sites you have listed and what they offer. Also, because you have “etc.”, there can be no definitive response on capabilities for the sites, though the likelihood is that there will not be one or more APIs for all.

Without APIs you would have to roll your own web scraper for each site that processes the differing formats on each page, and then builds a results set. Apart from being a little bit painful to do in the first place, even a small change in the site can break such a scraper; depending upon what the change is.

A third option would simply be having an automation open each of the searches in consecutive Safari tabs and I would expect that would absolutely feasible - whether by coding search URLs for each site directly, or for DDG. AppleScript could support that approach.

A fourth option might be a comparison site. There are comparison sites for all sorts of stuff out there. Maybe you could find, or someone could recommend, one that would allow you to search across multiple suppliers. The downside is it might not include all of the sites you want, but the upside is that it would be the least amount of work.

0 Likes