feat: add search tools (#58)

This commit is contained in:
sigoden
2024-07-05 19:49:26 +08:00
committed by GitHub
parent c7e027c6c3
commit 74789b5a72
8 changed files with 125 additions and 21 deletions
+15
View File
@@ -0,0 +1,15 @@
#!/usr/bin/env bash
set -e
# @describe Search arXiv for a query and return the top papers.
# @env ARXIV_MAX_RESULTS=5 The max results to return.
# @option --query! The query to search for.
main() {
encoded_query="$(jq -nr --arg q "$argc_query" '$q|@uri')"
url="http://export.arxiv.org/api/query?search_query=all:$encoded_query&max_results=$ARXIV_MAX_RESULTS"
curl -fsSL "$url"
}
eval "$(argc --argc-eval "$0" "$@")"