From b0ce53c4559a357810f8275519823275d94c3076 Mon Sep 17 00:00:00 2001 From: syui Date: Thu, 19 Sep 2024 08:35:50 +0000 Subject: [PATCH] =?UTF-8?q?atproto=20=E3=82=92=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- atproto.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/atproto.md b/atproto.md index 7a52ab4..201fc2a 100644 --- a/atproto.md +++ b/atproto.md @@ -36,6 +36,24 @@ url=$api/com.atproto.repo.getRecord curl -sL "$url?repo=$did&collection=$collection&rkey=$rkey&cid="|jq . ``` +## login + +```sh +# session +host=bsky.social +handle=syui.bsky.social +pass=xxx +url=https://$host/xrpc/com.atproto.server.createSession +curl -sL -X POST -H "Content-Type: application/json" -d "{\"identifier\":\"$handle\",\"password\":\"$pass\"}" $url + +# refresh +j=`!!` +token=`echo $j|jq -r .accessJwt` +refresh=`echo $j|jq -r .refreshJwt` +url=https://$host/xrpc/com.atproto.server.refreshSession +curl -sL -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $refresh" $url +``` + ## jq ここでは[aios](https://git.syui.ai/ai/os)にインストールされている[jq](https://github.com/jqlang/jq), [dasel](https://github.com/TomWright/dasel)の`example`をまとめます。