Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Implement qwant search engine support #605

Draft
wants to merge 5 commits into
base: rolling
Choose a base branch
from

Conversation

nrabulinski
Copy link

What does this PR do?

Implements the Qwant search engine support

Why is this change important?

I wanted to contribute the Qwant search engine support

How to test this PR locally?

Run websurfx and enable the Qwant search engine

Additional notes

Sometimes, requesting results from Qwant fails. So far I've encountered error 22 which I don't know what it means, and error 27 which means completing a captcha is required. Second request pretty much always works for me though. Not sure if that's an acceptable state, if not, I'm happy to potentially help with captcha implementation.

This search engine is implemented using the API, contrary to other ones which use scripting. That's because Qwant's frontend is not paginated and there's no way to force it to be, so I couldn't scrape more than one page worth of results. And because of that I decided to just use the API itself.

Related issues

Closes #317

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Congrats on making your first Pull Request and thanks for taking the time to improve Websurfx! ❤️!
Say hello by joining the conversation in our Discord

This makes sure that if a user uses & or any other symbol with
special meaning their query won't get broken
@neon-mmd neon-mmd changed the title Implement Qwant search engine support ✨ Implement qwant search engine support Sep 7, 2024
@neon-mmd neon-mmd added this to the Complete v2.0.0 release milestone Sep 7, 2024
Copy link
Owner

@neon-mmd neon-mmd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks ❤️ for working on such a wonderful PR. Good job!! Keep it up!! 👍 But before we merge this PR in, I would like to suggest a few changes. 🙂

Comment on lines +144 to +152
let result: QwantApiResponse = client
.get(url)
.headers(header_map)
.send()
.await
.change_context(EngineError::RequestError)?
.json()
.await
.change_context(EngineError::RequestError)?;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you could have used the already available json_as_bytes_from_upstream function to fetch data and deserialize it using something like bincode. What do you think? 🙂 .

@neon-mmd neon-mmd marked this pull request as draft October 8, 2024 15:21
@neon-mmd
Copy link
Owner

neon-mmd commented Nov 3, 2024

@nrabulinski It has been a week. Any updates on this draft PR? 🙂 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

Qwant for the search engine
2 participants