Skip to content
This repository has been archived by the owner on Sep 7, 2023. It is now read-only.

Add Docker Hub search engine. #2543

Closed
wants to merge 5 commits into from

Conversation

SuperSonicHub1
Copy link
Contributor

MySQL Docker image
Searx Docker image

What does this PR do?

This adds Docker Hub to Searx as a search engine and resolves issue #2433. I modeled this engine around the existing SoundCloud engine, the engine's favicon was downloaded from the Docker Hub website with wget and converted to a PNG with ImageMagick, and the shortcut was plucked from DDG's bangs database. It supports the parsing of URLs, titles, content, published dates, and thumbnails of Docker images.

Why is this change important?

Once again, I wanted to resolve issue #2433. As a semi-regular user of the Hub myself, I'm sure many developers would find the direct ability to search for Docker images very convenient.

How to test this PR locally?

This PR is fully compatible with make test. To see it in action:

  • make run
  • query !dockerhub searx

Related issues

Closes #2433

@@ -26,3 +26,5 @@ dist/
local/
gh-pages/
searx.egg-info/

.vscode/
Copy link
Member

Choose a reason for hiding this comment

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

Please do not add any editor specific line to this file.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK. How do you suggest I stop my config from being pushed without manually staging each of my commits?

Copy link
Contributor

Choose a reason for hiding this comment

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

without manually staging each of my commits?

what should that tell me?!? Please learn git and SCM basics .. to me it seems you won't learn for what all this is good.

Copy link
Contributor

Choose a reason for hiding this comment

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

How do you suggest I stop my config from being pushed without manually staging each of my commits?

See https://stackoverflow.com/questions/5724455/can-i-make-a-user-specific-gitignore-file

@results JSON
@stable yes
@parse url, title, content, thumbnail, publishedDate
"""
Copy link
Contributor

Choose a reason for hiding this comment

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

Please use 'about' notation / like any other engine does, here is an example from the google engine:

about = {
"website": 'https://www.google.com',
"wikidata_id": 'Q9366',
"official_api_documentation": 'https://developers.google.com/custom-search/',
"use_official_api": False,
"require_api_key": False,
"results": 'HTML',
}

Copy link
Contributor

Choose a reason for hiding this comment

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

The wikidata_id is Q100769064 : https://www.wikidata.org/wiki/Q100769064

Comment on lines +25 to +33
'''pre-request callback
params<dict>:
method : POST/GET
headers : {}
data : {} # if method == POST
url : ''
category: 'search category'
pageno : 1 # number of the requested page
'''
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess these doc-strings can be dropped .. if there is something special to this engine, it is good to write down a doc-string, but if it is only C&P better leaf it.

@return42
Copy link
Contributor

return42 commented Feb 8, 2021

@SuperSonicHub1 thanks a lot for another engine!! ..I really like your contributions, but there is one thing that disturbs me: it is the commit history. In the master branch we want to avoid a cluttered history. It is very hard to maintain code if the history is cluttered. Can you please squash your commits to one and have one clear commit message / thanks!

In #2429 (comment) I gave you some links about git-workflows at hand.

I guess the cluttered commit series is also one reason why #2429 hangs at the moment.

@unixfox
Copy link
Member

unixfox commented Mar 23, 2021

Hello,

Thank you for your contribution.

Could you squash your commits to a single commit?
Here is a tutorial about how to do it: https://blog.carbonfive.com/always-squash-and-rebase-your-git-commits/. It's not the only one, so feel free to learn from other tutorials if you want.

@return42
Copy link
Contributor

@SuperSonicHub1 see my comment at : #2429 (comment)

return42 pushed a commit to return42/searxng that referenced this pull request May 30, 2021
Slightly modified merge of commit [1cb1d3ac] from searx [PR 2543]:

      This adds Docker Hub .. as a search engine .. the engine's favicon was
      downloaded from the Docker Hub website with wget and converted to a PNG
      with ImageMagick .. It supports the parsing of URLs, titles, content,
      published dates, and thumbnails of Docker images.

[1cb1d3ac] searx/searx@1cb1d3ac
[PR 2543] searx/searx#2543

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Engine request: DockerHub
5 participants