ai/at
ai/at
1
0
This commit is contained in:
syui 2024-11-27 22:30:50 +09:00
parent 57013e14ee
commit e3faeeb975
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 com.atproto.repo.describeRepo
/xrpc/com.atproto.repo.getRecord com.atproto.repo.getRecord
/xrpc/com.atproto.repo.listRecords com.atproto.repo.listRecords
/xrpc/com.atproto.identity.resolveHandle com.atproto.identity.resolveHandle
) )
function at-env(){ function at-env(){
@ -62,6 +62,15 @@ function at-collection-search(){
curl -sL "$url?repo=$did&collection=$collection&reverse=$reverse"|jq . curl -sL "$url?repo=$did&collection=$collection&reverse=$reverse"|jq .
} }
function at-docs(){
for i in $lexicon; do
req=`echo $i|tr '.' '-'|sed 's/[A-Z]/-&/g'|tr '[A-Z]' '[a-z]'`
url=https://docs.bsky.app/docs/api/$req
echo $url
done
}
at-env at-env
case $1 in case $1 in
uri|u) uri|u)
@ -73,6 +82,9 @@ case $1 in
collection|c) collection|c)
at-collection-search $2 $3 at-collection-search $2 $3
;; ;;
at-docs|docs)
at-docs
;;
*) *)
echo "${help[@]}" echo "${help[@]}"
echo "${host[@]}" echo "${host[@]}"