Compare commits
2 Commits
98070e11a6
...
db0a6ca79d
Author | SHA1 | Date | |
---|---|---|---|
db0a6ca79d | |||
4b3fdffd19 |
|
@ -52,8 +52,7 @@ in
|
|||
libreoffice
|
||||
protonmail-bridge
|
||||
pass
|
||||
protonvpn-cli
|
||||
protonvpn-gui
|
||||
protonvpn-cli_2
|
||||
thunderbird
|
||||
tidal-hifi
|
||||
signal-desktop
|
||||
|
@ -161,6 +160,7 @@ in
|
|||
lspcfg.typst_lsp.setup({
|
||||
cmd = { '${pkgs.typst-lsp}/bin/typst-lsp' },
|
||||
})
|
||||
lspcfg.rust_analyzer.setup({})
|
||||
lspcfg.hls.setup({
|
||||
cmd = { '${hls_wrapper}', 'lsp' },
|
||||
})
|
||||
|
|
32
shared/nlabsearch.py
Normal file
32
shared/nlabsearch.py
Normal file
|
@ -0,0 +1,32 @@
|
|||
from bs4 import BeautifulSoup
|
||||
|
||||
baseurl = "https://ncatlab.org"
|
||||
|
||||
about = {
|
||||
"website": baseurl + "/nlab/show/HomePage",
|
||||
"use_official_api": False,
|
||||
"require_api_key": False,
|
||||
"results": "html"
|
||||
}
|
||||
|
||||
# basic search
|
||||
def request(query, params):
|
||||
params["url"] = baseurl + f"/nlab/search?query={query}"
|
||||
return params
|
||||
|
||||
def response(resp):
|
||||
|
||||
res = []
|
||||
|
||||
soup = BeautifulSoup(resp.content)
|
||||
|
||||
for entry in soup.select("#Content ul li a"):
|
||||
url = baseurl + entry["href"]
|
||||
title = entry.string
|
||||
res_dict = {
|
||||
"url": url,
|
||||
"title": title,
|
||||
}
|
||||
res.append(res_dict)
|
||||
|
||||
return res
|
Loading…
Reference in New Issue
Block a user