Homebrew / formulae.brew.sh

🏎 An online formulae browser for Homebrew
https://formulae.brew.sh
BSD 2-Clause "Simplified" License
1.49k stars 520 forks source link

DuckDuckGo Bang is broken -> what is the search page? #657

Closed MagicLegend closed 2 years ago

MagicLegend commented 2 years ago

What you were trying to do (and why)

The DuckDuckGo !brew bang is broken.

What happened (include screenshots)

Searching for !brew php leads to http://brewformulas.org/search?search%5Bterm%5D=php, which is a dead site. (Warning: Chinese spam at the main domain)

What you expected to happen

Come up with search results (or the direct page in case of a match), and lead me to https://formulae.brew.sh/formula/php#default.

Why am I submitting this here

Updating a bang can be done at https://duckduckgo.com/newbang. However, I can't quickly figure out what the url structure of the search page would be. Otherwise the bang would only work for direct matches. I would expect it to behave like the !npm bang, which leads to https://www.npmjs.com/search?q={{{s}}}. I see the searching is handled by algolia, is there a way to hook into that perhaps?

Other info

I am aware of the !brewf bang, which leads to https://formulae.brew.sh/formula/{{{s}}}. However, for non-existing packages this will show the Github Pages 404 page. E.g.: https://formulae.brew.sh/formula/qwer. I would want it to show a search page, and give me these results: image

SMillerDev commented 2 years ago

There is no search page so this is not possible.

EricFromCanada commented 2 years ago

Over a year ago I implemented a partial workaround where the search parameter contents is pre-filled in the search bar. However, all of my attempts to contact DuckDuckGo and have the !brew bang updated to https://formulae.brew.sh/?search={{{s}}} have gone unanswered.

MagicLegend commented 2 years ago

Oh that's great to see! Perhaps it DDG receives more requests to change a certain bang, it might get through the system faster? I have submitted it myself as well regardless :)