Compare commits
2 Commits
master
...
stdin2json
Author | SHA1 | Date | |
---|---|---|---|
|
b58f418a4a | ||
bccf53e401 |
2
list.csv
2
list.csv
@ -324,7 +324,7 @@ EINGLÜCKSFÄNGER,Close Encounters Corps,SCEC
|
|||||||
Eisem,Не состою (Not in a squadron),N/A
|
Eisem,Не состою (Not in a squadron),N/A
|
||||||
EkzekutorGraz,Royal Phoenix Security Group,RPSG
|
EkzekutorGraz,Royal Phoenix Security Group,RPSG
|
||||||
El Mario,Не состою (Not in a squadron),N/A
|
El Mario,Не состою (Not in a squadron),N/A
|
||||||
EL1GE,TEACOFFE DISCOVERY,N/A
|
EL1GE,Teacoffe Discovery,N/A
|
||||||
eLCy,Close Encounters Corps,SCEC
|
eLCy,Close Encounters Corps,SCEC
|
||||||
Elfairiwen,Close Encounters Corps,SCEC
|
Elfairiwen,Close Encounters Corps,SCEC
|
||||||
ELITYRA,Не состою (Not in a squadron),N/A
|
ELITYRA,Не состою (Not in a squadron),N/A
|
||||||
|
|
@ -1,29 +1,29 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -e
|
set -ex
|
||||||
|
|
||||||
send() {
|
send() {
|
||||||
local _msg=$1
|
local _msg=$1
|
||||||
if [[ -z $_msg ]]; then
|
if [[ -z $_msg ]]; then
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
curl -X POST \
|
curl -X POST \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-d "{\"content\":\"\`\`\`diff\n$_msg\`\`\`\"}" \
|
-d "{\"content\":\"\`\`\`diff\n$_msg\`\`\`\"}" \
|
||||||
"$DISCORD_WEBHOOK"
|
"$DISCORD_WEBHOOK"
|
||||||
}
|
}
|
||||||
|
|
||||||
msg=""
|
msg=""
|
||||||
|
|
||||||
while IFS= read -r line; do
|
while IFS= read -r line; do
|
||||||
line="$(sed 's@"@\\"@g' <<< "$line")" # Json screening
|
line="$(sed 's@"@\\"@g' <<< "$line")" # Json screening
|
||||||
len="$(wc -m <<< "$msg$line")"
|
len="$(wc -m <<< "$msg$line")"
|
||||||
if [[ $len -ge 1985 ]]; then
|
if [[ $len -ge 1985 ]]; then
|
||||||
send "$msg"
|
send "$msg"
|
||||||
msg="$line"
|
msg="$line"
|
||||||
else
|
else
|
||||||
msg+="$line\\n"
|
msg+="$line\\n"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
send "$msg"
|
send "$msg"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user