-
Notifications
You must be signed in to change notification settings - Fork 97
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
base: rolling
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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
qwant
search engine support
There was a problem hiding this 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. 🙂
let result: QwantApiResponse = client | ||
.get(url) | ||
.headers(header_map) | ||
.send() | ||
.await | ||
.change_context(EngineError::RequestError)? | ||
.json() | ||
.await | ||
.change_context(EngineError::RequestError)?; |
There was a problem hiding this comment.
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? 🙂 .
@nrabulinski It has been a week. Any updates on this draft PR? 🙂 . |
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