diff --git a/at.zsh b/at.zsh index d956681..babccab 100755 --- a/at.zsh +++ b/at.zsh @@ -46,6 +46,21 @@ function at-did-search(){ 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 case $1 in uri|u) @@ -54,6 +69,9 @@ case $1 in did|d) at-did-search $2 ;; + collection|c) + at-collection-search $2 $3 + ;; *) echo "${help[@]}" echo "${host[@]}"