1
0
This commit is contained in:
syui 2024-02-08 15:36:52 +09:00
parent 09930024cb
commit 564ecad29f
Signed by: syui
GPG Key ID: 5417CFEBAD92DF56

27
scpt/notify.zsh Normal file
View File

@ -0,0 +1,27 @@
function notify() {
url=https://$host/xrpc/app.bsky.notification.listNotifications
if [ ! -f $d/notify.json ];then
curl -sL "Content-Type: application/json" -H "Authorization: Bearer $token" "$url?limit=100" >! $d/notify.json
fi
#cat $d/notify.json
for ((i=0;i<=99;i++))
do
cid=`cat $d/notify.json|jq ".|.[].[$i]?|.cid?"`
uri=`cat $d/notify.json|jq ".|.[].[$i]?|.uri?"`
echo $cid
echo $uri
cid_r=`cat $d/notify.json|jq ".[]|.[$i]?|.record.reply.root.cid?"`
if [ "$cid_r" = "null" ];then
continue
fi
uri_r=`cat $d/notify.json|jq ".[]|.[$i]?|.record.reply.root.uri?"`
cid_p=`cat $d/notify.json|jq ".[]|.[$i]?|.record.reply.parent.cid?"`
uri_p=`cat $d/notify.json|jq ".[]|.[$i]?|.record.reply.parent.uri?"`
echo $cid_r
echo $uri_r
echo $cid_p
echo $uri_p
done
}