mirror of
https://git.phreedom.club/localhost_frssoft/bbs-telnet
synced 2024-11-24 02:39:20 +02:00
Compare commits
2 Commits
bcf33de7e1
...
b3a414ab7e
Author | SHA1 | Date | |
---|---|---|---|
localhost_frssoft | b3a414ab7e | ||
localhost_frssoft | f62ac374a1 |
14
executor.sh
14
executor.sh
|
@ -2,19 +2,6 @@
|
||||||
|
|
||||||
. ./config
|
. ./config
|
||||||
|
|
||||||
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
|
|
||||||
}
|
|
||||||
|
|
||||||
timeline_home(){
|
|
||||||
curl -s -H "Authorization: Bearer $instance_token" "https://$instance/api/v1/timelines/home?limit=40&max_id=$1" |
|
|
||||||
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'
|
|
||||||
}
|
|
||||||
|
|
||||||
remote_ip=$SOCAT_PEERADDR
|
remote_ip=$SOCAT_PEERADDR
|
||||||
die(){
|
die(){
|
||||||
rm access_granted/"$remote_ip"
|
rm access_granted/"$remote_ip"
|
||||||
|
@ -26,6 +13,7 @@ mkdir -p -m 700 access_granted
|
||||||
mkdir -p -m 700 access_denied
|
mkdir -p -m 700 access_denied
|
||||||
|
|
||||||
if [ -f access_denied/"$remote_ip" ]; then exit 0; fi
|
if [ -f access_denied/"$remote_ip" ]; then exit 0; fi
|
||||||
|
. ./mastodon_api.sh
|
||||||
|
|
||||||
generator_session=$(zcat -f $system_dict | shuf -n 2 | tr -d "\n'")
|
generator_session=$(zcat -f $system_dict | shuf -n 2 | tr -d "\n'")
|
||||||
randpadding=$(head -c 8 /dev/urandom | base64)
|
randpadding=$(head -c 8 /dev/urandom | base64)
|
||||||
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
#/bin/sh
|
||||||
|
|
||||||
|
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
|
||||||
|
}
|
||||||
|
|
||||||
|
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(){
|
||||||
|
curl -s -H "Authorization: Bearer $instance_token" "https://$instance/api/v1/timelines/home?limit=40&max_id=$1" | timeline_render
|
||||||
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue