summaryrefslogtreecommitdiff
path: root/searx/engines/hex.py
diff options
context:
space:
mode:
authorDaniel Kukula <daniel.kuku@gmail.com>2024-05-06 07:33:24 +0100
committerMarkus Heiser <markus.heiser@darmarIT.de>2024-05-15 12:50:35 +0200
commitcc8b537e3446444cba4196b73bc49a7ef4a6def3 (patch)
tree7efd77bd05ab10ed3ba620400b1e5b2c981a98ad /searx/engines/hex.py
parent645a840d8211a016d808cf7da1ab62ff12d1db56 (diff)
downloadsearxng-cc8b537e3446444cba4196b73bc49a7ef4a6def3.tar.gz
searxng-cc8b537e3446444cba4196b73bc49a7ef4a6def3.zip
[mod] package.html template: additional links (a python dict)
- Closes: https://github.com/searxng/searxng/issues/3456
Diffstat (limited to 'searx/engines/hex.py')
-rw-r--r--searx/engines/hex.py17
1 files changed, 8 insertions, 9 deletions
diff --git a/searx/engines/hex.py b/searx/engines/hex.py
index febd36d73..28b536d97 100644
--- a/searx/engines/hex.py
+++ b/searx/engines/hex.py
@@ -33,23 +33,22 @@ def response(resp):
results = []
for package in resp.json():
meta = package["meta"]
- publishedDate = package.get("inserted_at")
- if publishedDate:
- publishedDate = parser.parse(publishedDate)
- tags = meta.get("licenses", [])
+ published_date = package.get("updated_at")
+ published_date = parser.parse(published_date)
+ links = meta.get("links")
results.append(
{
"template": "packages.html",
- "url": package["url"],
+ "url": package["html_url"],
"title": package["name"],
"package_name": package["name"],
"content": meta.get("description", ""),
"version": meta.get("latest_version"),
"maintainer": ", ".join(meta.get("maintainers", [])),
- "publishedDate": publishedDate,
- "tags": tags,
- "homepage": meta.get("links", {}).get("homepage"),
- "source_code_url": meta.get("links", {}).get("github"),
+ "publishedDate": published_date,
+ "license_name": ", ".join(meta.get("licenses", [])),
+ "homepage": package["docs_html_url"],
+ "links": links,
}
)