notifs added

This commit is contained in:
localhost_frssoft 2023-07-24 16:37:34 +03:00
parent 9df621aaf6
commit 2bfe5c5a4a
2 changed files with 13 additions and 0 deletions

View File

@ -49,6 +49,7 @@ while read -r cmd mesg; do
reply=$reply_id toot "$status" | jq '.id, .errors' reply=$reply_id toot "$status" | jq '.id, .errors'
reply='' reply=''
;; ;;
"notifs") notifications ;;
"home") "home")
tlhome=$(timeline_home "$mesg") tlhome=$(timeline_home "$mesg")
tlhome_len=$(echo "$tlhome" | wc -l) tlhome_len=$(echo "$tlhome" | wc -l)

View File

@ -12,8 +12,20 @@ timeline_render(){
end | @text' end | @text'
} }
notifications_render(){
cat - | jq -r '.[] |
"[\(.type) \(.created_at) \(.account.acct)]",
if .status then
.status.id, .status.pleroma.content."text/plain"
else empty
end | @text'
}
timeline_home(){ timeline_home(){
curl -s -H "Authorization: Bearer $instance_token" "https://$instance/api/v1/timelines/home?limit=40&max_id=$1" | timeline_render curl -s -H "Authorization: Bearer $instance_token" "https://$instance/api/v1/timelines/home?limit=40&max_id=$1" | timeline_render
} }
notifications(){
curl -s -H "Authorization: Bearer $instance_token" "https://$instance/api/v1/notifications?limit=40&max_id=$1" | notifications_render
}