Recipe search engine
⊠2023-04-13
America's Test Kitchen,
bon appétit,
David Lebovitz,
Epicurious,
Food52,
NYT Cooking,
The Spruce Eats,
Woolworths TASTE
Ben Tilden had this clever idea (archive). He created a custom Google search form that limits search results to specific recipe websites. The website list includes sites like New York Times Cooking and Serious Eats.
Benâs raison dâĂȘtre for the custom search engine was:
[âŠ] finding good recipes online can be surprisingly hard. One of the main problems is the sheer volume of information available. With so many websites, blogs, and recipe databases to choose from, it can be overwhelming.
And then thereâs quality control. Anyone can post a recipe online, regardless of their cooking experience or knowledge. You mayâscratch thatâyou will come across recipes that are poorly written, inaccurate, or just donât work.
I thought that was a really neat idea but I wanted to make a few changes to Benâs search engine:
- I wanted to add my own recipe websites. Benâs list is goodâit has many of the sites I usually reach forâbut there are others I think should be included. Sites Iâve found helpful over the years.
- I wanted it to use Duck Duck Go (DDG) for search. Thereâs no need to give Google everyoneâs data unnecessarily.
I wanted to avoid Javascript. DDG is pretty configurable through HTML forms and so why bother with JS?Read below.
Ben used Googleâs Programmable Search Engine for his project.
It works by configuring a list of sites you want to search and then embedding a Google search box wherever it makes sense on your website.
Google lets you set multiple websites in the search list and supports basic wildcarding like *.kieran.casa/*
.
Building a custom search engine on DDG turned out to be trickier than expected.
DDG allows you to customize a surprisingly large amount of the search experience.
Its Params (archive) documentation lists all sorts of settings you can configure using URL query parameters.
Did you know that you can turn off advertisements with the k1
param?
Strangely absent from that documentation is the sites
parameter.
This query parameter clearly exists (click on this search to see: https://duckduckgo.com/?q=test&sites=kieran.casa).
And has been mentioned around the web (archive).
But at some point in the past lost the ability to filter for multiple different sites.
Or maybe it never had it?
Anyway, after a good few hours trying to send multiple domains through the sites
query parameter I gave up.
So my solution then. As I couldnât get a pure query parameter-based search form working, I had to resort to using Javascript to append a website filter to the search query. It is certianly not the end of the world, but a bit of a pity nonetheless.
A special thanks to Ben for the original idea and to Pat Dryburgh for his help and handy DuckDuckGo Search Box Generator (archive).