fix pds
This commit is contained in:
parent
c2dc0b72d5
commit
c6ccde30cb
@ -1,5 +1,5 @@
|
|||||||
function at-env() {
|
function at-env() {
|
||||||
host=bsky.social
|
host=https://bsky.social
|
||||||
handle_syui=syui.ai
|
handle_syui=syui.ai
|
||||||
handle_yui=yui.syui.ai
|
handle_yui=yui.syui.ai
|
||||||
did_yui=did:plc:4hqjfn7m6n5hno3doamuhgef
|
did_yui=did:plc:4hqjfn7m6n5hno3doamuhgef
|
||||||
@ -15,6 +15,7 @@ function at-env() {
|
|||||||
d=${0:a:h}
|
d=${0:a:h}
|
||||||
f=~/.config/.at-zsh.json
|
f=~/.config/.at-zsh.json
|
||||||
if [ -f $f ];then
|
if [ -f $f ];then
|
||||||
|
host=`cat $f|jq -r ".didDoc.service.[].serviceEndpoint"`
|
||||||
token=`cat $f|jq -r .accessJwt`
|
token=`cat $f|jq -r .accessJwt`
|
||||||
did=`cat $f|jq -r .did`
|
did=`cat $f|jq -r .did`
|
||||||
handle=`cat $f|jq -r .handle`
|
handle=`cat $f|jq -r .handle`
|
||||||
@ -103,7 +104,7 @@ function at-refresh() {
|
|||||||
echo $f
|
echo $f
|
||||||
token=`cat $f|jq -r .refreshJwt`
|
token=`cat $f|jq -r .refreshJwt`
|
||||||
req=/xrpc/com.atproto.server.refreshSession
|
req=/xrpc/com.atproto.server.refreshSession
|
||||||
url=https://${host}${req}
|
url=${host}${req}
|
||||||
t=`curl -sL -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $token" $url`
|
t=`curl -sL -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $token" $url`
|
||||||
if echo $t |jq .;then
|
if echo $t |jq .;then
|
||||||
echo $t >! $f
|
echo $t >! $f
|
||||||
@ -114,13 +115,13 @@ function at-cid() {
|
|||||||
did=`at-did $1|jq -r .did`
|
did=`at-did $1|jq -r .did`
|
||||||
cid=$2
|
cid=$2
|
||||||
req=/xrpc/com.atproto.sync.getBlob
|
req=/xrpc/com.atproto.sync.getBlob
|
||||||
url="https://${host}${req}?did=${did}&cid=${cid}"
|
url="${host}${req}?did=${did}&cid=${cid}"
|
||||||
curl -sL $url
|
curl -sL $url
|
||||||
}
|
}
|
||||||
|
|
||||||
function at-session() {
|
function at-session() {
|
||||||
req=/xrpc/com.atproto.server.getSession
|
req=/xrpc/com.atproto.server.getSession
|
||||||
url=https://${host}${req}
|
url=${host}${req}
|
||||||
t=`curl -sL -X GET -H "Content-Type: application/json" -H "Authorization: Bearer $token" $url`
|
t=`curl -sL -X GET -H "Content-Type: application/json" -H "Authorization: Bearer $token" $url`
|
||||||
if ! echo $t |jq .;then
|
if ! echo $t |jq .;then
|
||||||
echo refresh
|
echo refresh
|
||||||
@ -136,6 +137,6 @@ function at-profile() {
|
|||||||
t=`at-session`
|
t=`at-session`
|
||||||
fi
|
fi
|
||||||
req=/xrpc/app.bsky.actor.getProfile
|
req=/xrpc/app.bsky.actor.getProfile
|
||||||
url="https://${host}${req}?actor=$did"
|
url="${host}${req}?actor=$did"
|
||||||
curl -sL -X GET -H "Content-Type: application/json" -H "Authorization: Bearer $token" $url|jq .
|
curl -sL -X GET -H "Content-Type: application/json" -H "Authorization: Bearer $token" $url|jq .
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user