hnhx / librex

Framework and javascript free privacy respecting meta search engine
GNU Affero General Public License v3.0
775 stars 87 forks source link

Add duckduckgo as an upstream search engine for text #234

Closed 305a385 closed 1 year ago

305a385 commented 1 year ago

Add duckduckgo as upstream search engine

Info:

Tasks

Testing

(this assumes your config.php has just been copied from config.php.example) search for the line "text" => "google" and change it to "text" => "duckduckgo"

Solves: #232

hnhx commented 1 year ago

Why did you make the preferred engine an array if its only 1 value lol Also this doesnt really make ddg a fallback nor you can get both search results at once, you have to manually change the config file if google blocks you.

305a385 commented 1 year ago

Why did you make the preferred engine an array if its only 1 value lol

In case we decide to add something like this for images, etc. It makes it easily upgradable

this doesnt really make ddg a fallback nor you can get both search results at once, you have to manually change the config file if google blocks you.

I thought of that but forgot to add it to the tasks list

codedipper commented 1 year ago

This is a great feature, thank you! Another thing for public instance owners, there should be a section in the README that makes it clear what the default engine is.

Also using DuckDuckGo on my onion instance because I do searches on onion and I want my search engine to actually be usable.

ghjardim commented 1 year ago

@codedipper I agree. Using DuckDuckGo enables webscraping through proxies easier.

ghjardim commented 1 year ago

@305a385, it seems to have a problem with the duckduckgo code. I've tried to query "linux-libre", and only the Linux-Libre card was displayed, while the actual results were omitted. Doing the same query in public instances (that use Google engine) doesn't lead to this problem, and the results are shown.

305a385 commented 1 year ago

Sorry to everyone for the late reply

@hnhx was right, duckduckgo gives terrible results, more specifically html.duckduckgo.com gives terrible results. It doesn't even support safe search!

If anyone wants to continue this work I would recommend restarting this using something like brave search instead

codedipper commented 1 year ago

Hello, we implemented your change into Ahwxorg/LibreY#2! LibreY is a fork of LibreX to remove unwanted changes and because the original LibreX repository (hnhx/librex) appears to be dead. We love you <3