Last active
November 2, 2018 05:37
-
-
Save mogi/e57ca28cf1ef7ae74c780ebe3c4461f8 to your computer and use it in GitHub Desktop.
運用連絡の雛形を出力する
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SS=$1 | |
# get json | |
curl -s "https://api.rss2json.com/v1/api.json?rss_url=https%3A%2F%2Fstatus.cybozu.com%2Frss%2Fmonitor-${SS}?tz=540" > /tmp/${SS}.json | |
# output template | |
cat << EOS | |
以下の時間帯、サービスにアクセスし辛くなっていました。 | |
現在は解消しています。 | |
EOS | |
# output messages | |
echo "${SS}" | |
echo "https://status.cybozu.com/status/monitor-${SS}" | |
json=$(cat /tmp/ty31.json |jq .items) | |
len=$(echo $json | jq length) | |
for i in $( seq 0 $(($len - 1)) ); do | |
echo $json | jq -r .[$i].title | |
echo $json | jq -r .[$i].content | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
出力例