ai/at
ai/at
1
0
This commit is contained in:
syui 2024-11-27 20:28:31 +09:00
parent 14dee0d584
commit 9894e5b781
Signed by: syui
GPG Key ID: 5417CFEBAD92DF56

18
at.zsh
View File

@ -46,6 +46,21 @@ function at-did-search(){
curl -sL "$url?repo=$handle"|jq . curl -sL "$url?repo=$handle"|jq .
} }
function at-collection-search(){
reverse=false
if [ -n "$1" ];then
at_uri=$1
fi
if [ "$2" = "-r" ];then
reverse=true
fi
req=xrpc/com.atproto.repo.listRecords
url=https://${host}/${req}
did=`echo $at_uri|cut -d / -f 3`
collection=`echo $at_uri|cut -d / -f 4`
curl -sL "$url?repo=$did&collection=$collection&reverse=$reverse"|jq .
}
at-env at-env
case $1 in case $1 in
uri|u) uri|u)
@ -54,6 +69,9 @@ case $1 in
did|d) did|d)
at-did-search $2 at-did-search $2
;; ;;
collection|c)
at-collection-search $2 $3
;;
*) *)
echo "${help[@]}" echo "${help[@]}"
echo "${host[@]}" echo "${host[@]}"