Milim
commited on
Commit
β’
dbe5b53
1
Parent(s):
e2907ed
fix spelling
Browse files- CONTRIBUTING.md +1 -1
- PULL_REQUEST_TEMPLATE.md +1 -1
- README.md +2 -2
- src/engines/duckduckgo.rs +2 -2
- src/engines/engine_models.rs +1 -1
- src/search_results_handler/aggregator.rs +1 -1
CONTRIBUTING.md
CHANGED
@@ -14,7 +14,7 @@ Know how to fix or improve a github action?. Consider Submitting a Pull request
|
|
14 |
|
15 |
## Source Code
|
16 |
|
17 |
-
You should know
|
18 |
|
19 |
- Rust basics
|
20 |
- Actix-web crate basics
|
|
|
14 |
|
15 |
## Source Code
|
16 |
|
17 |
+
You should know at least one of the things below to start contributing:
|
18 |
|
19 |
- Rust basics
|
20 |
- Actix-web crate basics
|
PULL_REQUEST_TEMPLATE.md
CHANGED
@@ -16,7 +16,7 @@
|
|
16 |
|
17 |
## Author's checklist
|
18 |
|
19 |
-
<!-- additional notes for
|
20 |
|
21 |
## Related issues
|
22 |
|
|
|
16 |
|
17 |
## Author's checklist
|
18 |
|
19 |
+
<!-- additional notes for reviewers -->
|
20 |
|
21 |
## Related issues
|
22 |
|
README.md
CHANGED
@@ -59,7 +59,7 @@
|
|
59 |
- **Community**
|
60 |
- [π System Requirements](#system-requirements-)
|
61 |
- [π¨οΈ FAQ (Frequently Asked Questions)](#faq-frequently-asked-questions-)
|
62 |
-
- [π£ More
|
63 |
- [π Supporting Websurfx](#supporting-websurfx-)
|
64 |
- [π Documentation](#documentation-)
|
65 |
- [π£οΈ Roadmap](#roadmap-)
|
@@ -165,7 +165,7 @@ Websurfx is based on Rust due to its memory safety features, which prevents vuln
|
|
165 |
|
166 |
**[β¬οΈ Back to Top](#--)**
|
167 |
|
168 |
-
# More
|
169 |
|
170 |
We are looking for more willing contributors to help grow this project. For more information on how you can contribute, check out the [project board](https://github.com/neon-mmd/websurfx/projects?query=is%3Aopen) and the [CONTRIBUTING.md](CONTRIBUTING.md) file for guidelines and rules for making contributions.
|
171 |
|
|
|
59 |
- **Community**
|
60 |
- [π System Requirements](#system-requirements-)
|
61 |
- [π¨οΈ FAQ (Frequently Asked Questions)](#faq-frequently-asked-questions-)
|
62 |
+
- [π£ More Contributors Wanted](#more-contributers-wanted-)
|
63 |
- [π Supporting Websurfx](#supporting-websurfx-)
|
64 |
- [π Documentation](#documentation-)
|
65 |
- [π£οΈ Roadmap](#roadmap-)
|
|
|
165 |
|
166 |
**[β¬οΈ Back to Top](#--)**
|
167 |
|
168 |
+
# More Contributors Wanted π£
|
169 |
|
170 |
We are looking for more willing contributors to help grow this project. For more information on how you can contribute, check out the [project board](https://github.com/neon-mmd/websurfx/projects?query=is%3Aopen) and the [CONTRIBUTING.md](CONTRIBUTING.md) file for guidelines and rules for making contributions.
|
171 |
|
src/engines/duckduckgo.rs
CHANGED
@@ -36,7 +36,7 @@ pub async fn results(
|
|
36 |
user_agent: &str,
|
37 |
) -> Result<HashMap<String, RawSearchResult>, EngineError> {
|
38 |
// Page number can be missing or empty string and so appropriate handling is required
|
39 |
-
// so that upstream server
|
40 |
let url: String = match page {
|
41 |
1 => {
|
42 |
format!("https://html.duckduckgo.com/html/?q={query}&s=&dc=&v=1&o=json&api=/d.js")
|
@@ -86,7 +86,7 @@ pub async fn results(
|
|
86 |
let results: String = reqwest::Client::new()
|
87 |
.get(url)
|
88 |
.timeout(Duration::from_secs(5))
|
89 |
-
.headers(header_map) // add spoofed headers to emulate human
|
90 |
.send()
|
91 |
.await
|
92 |
.into_report()
|
|
|
36 |
user_agent: &str,
|
37 |
) -> Result<HashMap<String, RawSearchResult>, EngineError> {
|
38 |
// Page number can be missing or empty string and so appropriate handling is required
|
39 |
+
// so that upstream server receives valid page number.
|
40 |
let url: String = match page {
|
41 |
1 => {
|
42 |
format!("https://html.duckduckgo.com/html/?q={query}&s=&dc=&v=1&o=json&api=/d.js")
|
|
|
86 |
let results: String = reqwest::Client::new()
|
87 |
.get(url)
|
88 |
.timeout(Duration::from_secs(5))
|
89 |
+
.headers(header_map) // add spoofed headers to emulate human behavior
|
90 |
.send()
|
91 |
.await
|
92 |
.into_report()
|
src/engines/engine_models.rs
CHANGED
@@ -13,7 +13,7 @@ use std::fmt;
|
|
13 |
/// search engines.
|
14 |
/// * `UnexpectedError` - This variant handles all the errors which are unexpected or occur rarely
|
15 |
/// and are errors mostly related to failure in initialization of HeaderMap, Selector errors and
|
16 |
-
/// all other errors
|
17 |
#[derive(Debug)]
|
18 |
pub enum EngineError {
|
19 |
EmptyResultSet,
|
|
|
13 |
/// search engines.
|
14 |
/// * `UnexpectedError` - This variant handles all the errors which are unexpected or occur rarely
|
15 |
/// and are errors mostly related to failure in initialization of HeaderMap, Selector errors and
|
16 |
+
/// all other errors occurring within the code handling the `upstream search engines`.
|
17 |
#[derive(Debug)]
|
18 |
pub enum EngineError {
|
19 |
EmptyResultSet,
|
src/search_results_handler/aggregator.rs
CHANGED
@@ -17,7 +17,7 @@ use crate::engines::{duckduckgo, searx};
|
|
17 |
/// then removes duplicate results and if two results are found to be from two or more engines
|
18 |
/// then puts their names together to show the results are fetched from these upstream engines
|
19 |
/// and then removes all data from the HashMap and puts into a struct of all results aggregated
|
20 |
-
/// into a vector and also adds the query used into the struct this is
|
21 |
/// otherwise the search bar in search remains empty if searched from the query url
|
22 |
///
|
23 |
/// # Example:
|
|
|
17 |
/// then removes duplicate results and if two results are found to be from two or more engines
|
18 |
/// then puts their names together to show the results are fetched from these upstream engines
|
19 |
/// and then removes all data from the HashMap and puts into a struct of all results aggregated
|
20 |
+
/// into a vector and also adds the query used into the struct this is necessary because
|
21 |
/// otherwise the search bar in search remains empty if searched from the query url
|
22 |
///
|
23 |
/// # Example:
|