mirror of
https://git.phreedom.club/localhost_frssoft/bbs-telnet
synced 2024-11-23 21:39:21 +02:00
jq as timeline render function
This commit is contained in:
parent
f62ac374a1
commit
b3a414ab7e
|
@ -4,13 +4,16 @@ toot(){
|
||||||
curl -s -X POST -F in_reply_to_id=$reply -F status="$1" -F visibility='unlisted' -H "Authorization: Bearer $instance_token" https://$instance/api/v1/statuses
|
curl -s -X POST -F in_reply_to_id=$reply -F status="$1" -F visibility='unlisted' -H "Authorization: Bearer $instance_token" https://$instance/api/v1/statuses
|
||||||
}
|
}
|
||||||
|
|
||||||
|
timeline_render(){
|
||||||
|
cat - | jq -r '.[] |
|
||||||
|
if .reblog then
|
||||||
|
"[up^ \(.reblog.id) \(.reblog.account.acct)]", .reblog.pleroma.content."text/plain", (.reblog.media_attachments[] | "+ attach \(.url)", .description // empty)
|
||||||
|
else "[\(.id) \(.account.acct)]", .pleroma.content."text/plain", (.media_attachments[] | "+ attach \(.url)", .description // 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" |
|
curl -s -H "Authorization: Bearer $instance_token" "https://$instance/api/v1/timelines/home?limit=40&max_id=$1" | timeline_render
|
||||||
jq -r '.[] |
|
|
||||||
if .reblog then
|
|
||||||
(["bump", .reblog.id, .reblog.account.acct] | join(" ")), .reblog.pleroma.content."text/plain", (.reblog.media_attachments[] | "attach", .url, .description // empty)
|
|
||||||
else [.id, .account.acct], .pleroma.content."text/plain", (.media_attachments[] | "attach", .url, .description // empty)
|
|
||||||
end | @text'
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue