-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[Feat] Add cargo package search #3487
Conversation
searx/engines/cargo.py
Outdated
|
||
|
||
def request(query: str, params): | ||
args = urlencode({"page": params["pageno"], "q": query, "per_page": 20}) |
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.
per_page could be made configurable in settings.yml
by making it a global variable called page_size
, but that's not mandatory
5b71989
to
27c9837
Compare
27c9837
to
83188b1
Compare
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 renamed the module from cargo.py
to crates.io
.. "cargo" is the package manager while "crates.io" is just one package repository / may we want to implement for example https://lib.rs/ at one day.
Due to the rebase on
and the rename to crates.py
this PR has changed significantly .. can you please review again / thanks!
"results": "JSON", | ||
} | ||
|
||
categories = ["it", "packages", "cargo"] |
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.
You can further use !cargo
.. when we implement other cargo reposetories we will add this engines also to group cargo
.. so with !cargo
we are able to search through all cargo managers in once.
|
||
# engine dependent config | ||
paging = True | ||
page_size = 10 |
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.
As @Bnyro mentioned .. the page_size is configurable and I reduced from 20 to 10 .. 10 results per page is the default what we have in nearly all engines.
engine: crates | ||
shortcut: crates | ||
disabled: true | ||
timeout: 6.0 |
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.
Forgot to say: I had timeout issues on search terms like !cargo test
or !cargo lib
.. so I increased timeout from the default 3sec to 6sec .. not sure this is a good value.
Can this be merged? I don't have permissions. |
sure .. I was just waiting for the OK from you for my modifications :-) |
What does this PR do?
Add cargo package search
this depends on changes from #3464