fix
This commit is contained in:
parent
fb987a6f73
commit
8f62e47aa1
57
at.zsh
Executable file
57
at.zsh
Executable file
@ -0,0 +1,57 @@
|
||||
#!/bin/zsh
|
||||
|
||||
host=(
|
||||
bsky.social
|
||||
public.api.bsky.app
|
||||
plc.directory
|
||||
)
|
||||
lexicon=(
|
||||
xrpc/com.atproto.repo.describeRepo
|
||||
xrpc/com.atproto.repo.getRecord
|
||||
xrpc/com.atproto.repo.listRecords
|
||||
xrpc/com.atproto.identity.resolveHandle
|
||||
)
|
||||
|
||||
function at-env(){
|
||||
host=bsky.social
|
||||
at_uri=at://did:plc:4hqjfn7m6n5hno3doamuhgef/ai.syui.game.user/syui
|
||||
did=`echo $at_uri|cut -d / -f 3`
|
||||
collection=`echo $at_uri|cut -d / -f 4`
|
||||
rkey=`echo $at_uri|cut -d / -f 5`
|
||||
}
|
||||
|
||||
function at-uri-search(){
|
||||
if [ -n "$1" ];then
|
||||
at_uri=$1
|
||||
fi
|
||||
req=xrpc/com.atproto.repo.getRecord
|
||||
url=https://${host}/${req}
|
||||
did=`echo $at_uri|cut -d / -f 3`
|
||||
collection=`echo $at_uri|cut -d / -f 4`
|
||||
rkey=`echo $at_uri|cut -d / -f 5`
|
||||
curl -sL "$url?repo=$did&collection=$collection&rkey=$rkey"|jq .
|
||||
}
|
||||
|
||||
function at-did-search(){
|
||||
if [ -n "$1" ];then
|
||||
handle=$1
|
||||
fi
|
||||
req=xrpc/com.atproto.repo.describeRepo
|
||||
url=https://${host}/${req}
|
||||
curl -sL "$url?repo=$handle"|jq .
|
||||
}
|
||||
|
||||
at-env
|
||||
case $1 in
|
||||
uri|u)
|
||||
at-uri-search $2
|
||||
;;
|
||||
did|d)
|
||||
at-did-search $2
|
||||
;;
|
||||
*)
|
||||
echo "${host[@]}"
|
||||
echo "${lexicon[@]}"
|
||||
;;
|
||||
esac
|
||||
|
Loading…
x
Reference in New Issue
Block a user