ai/at
ai/at
1
0
This commit is contained in:
syui 2024-11-27 22:10:23 +09:00
parent 5bdf1c92e6
commit 57013e14ee
Signed by: syui
GPG Key ID: 5417CFEBAD92DF56

20
at.zsh
View File

@ -11,10 +11,10 @@ host=(
plc.directory plc.directory
) )
lexicon=( lexicon=(
xrpc/com.atproto.repo.describeRepo /xrpc/com.atproto.repo.describeRepo
xrpc/com.atproto.repo.getRecord /xrpc/com.atproto.repo.getRecord
xrpc/com.atproto.repo.listRecords /xrpc/com.atproto.repo.listRecords
xrpc/com.atproto.identity.resolveHandle /xrpc/com.atproto.identity.resolveHandle
) )
function at-env(){ function at-env(){
@ -30,8 +30,8 @@ function at-uri-search(){
if [ -n "$1" ];then if [ -n "$1" ];then
at_uri=$1 at_uri=$1
fi fi
req=xrpc/com.atproto.repo.getRecord req=/xrpc/com.atproto.repo.getRecord
url=https://${host}/${req} url=https://${host}${req}
did=`echo $at_uri|cut -d / -f 3` did=`echo $at_uri|cut -d / -f 3`
collection=`echo $at_uri|cut -d / -f 4` collection=`echo $at_uri|cut -d / -f 4`
rkey=`echo $at_uri|cut -d / -f 5` rkey=`echo $at_uri|cut -d / -f 5`
@ -42,8 +42,8 @@ function at-did-search(){
if [ -n "$1" ];then if [ -n "$1" ];then
handle=$1 handle=$1
fi fi
req=xrpc/com.atproto.repo.describeRepo req=/xrpc/com.atproto.repo.describeRepo
url=https://${host}/${req} url=https://${host}${req}
curl -sL "$url?repo=$handle"|jq . curl -sL "$url?repo=$handle"|jq .
} }
@ -55,8 +55,8 @@ function at-collection-search(){
if [ "$2" = "-r" ];then if [ "$2" = "-r" ];then
reverse=true reverse=true
fi fi
req=xrpc/com.atproto.repo.listRecords req=/xrpc/com.atproto.repo.listRecords
url=https://${host}/${req} url=https://${host}${req}
did=`echo $at_uri|cut -d / -f 3` did=`echo $at_uri|cut -d / -f 3`
collection=`echo $at_uri|cut -d / -f 4` collection=`echo $at_uri|cut -d / -f 4`
curl -sL "$url?repo=$did&collection=$collection&reverse=$reverse"|jq . curl -sL "$url?repo=$did&collection=$collection&reverse=$reverse"|jq .