Init: research structure, tools (lg.py, rsl.py, sx.sh), AGENTS.md, CONTEXT.md, section 04 skeleton (39 book notes)
This commit is contained in:
commit
9b8cf58a4d
55 changed files with 1421 additions and 0 deletions
15
tools/sx.sh
Executable file
15
tools/sx.sh
Executable file
|
|
@ -0,0 +1,15 @@
|
|||
#!/bin/bash
|
||||
# SearXNG search helper: usage: ./sx.sh "query" [limit]
|
||||
q="$1"; lim="${2:-8}"
|
||||
curl -s --max-time 30 "http://localhost:8888/search" \
|
||||
--data-urlencode "q=$q" --data-urlencode "format=json" --data-urlencode "language=ru" \
|
||||
| python3 -c "
|
||||
import json,sys
|
||||
d=json.load(sys.stdin)
|
||||
for i,r in enumerate(d.get('results',[])[:$lim],1):
|
||||
print(f'{i}. {r[\"title\"]}')
|
||||
print(f' {r[\"url\"]}')
|
||||
c=r.get('content','').replace(chr(10),' ')
|
||||
if c: print(f' {c[:220]}')
|
||||
print()
|
||||
"
|
||||
Loading…
Add table
Add a link
Reference in a new issue