From 48f8b760b9b18db690a4caa373cf602aeaa011a1 Mon Sep 17 00:00:00 2001 From: Demonic Date: Thu, 10 Mar 2022 10:10:50 +0100 Subject: [PATCH] Add files via upload --- SHELL/lostarkstatus_bot.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 SHELL/lostarkstatus_bot.sh diff --git a/SHELL/lostarkstatus_bot.sh b/SHELL/lostarkstatus_bot.sh new file mode 100644 index 0000000..4051504 --- /dev/null +++ b/SHELL/lostarkstatus_bot.sh @@ -0,0 +1,21 @@ +#!/bin/sh + +curl -X 'GET' 'http://lostarkchc.herokuapp.com/server/Calvasus' -H 'accept: application/json' > /tmp/lostark/calvasus.json +curl -X 'GET' 'https://lostarkchc.herokuapp.com/steam/playercount' -H 'accept: application/json' > /tmp/lostark/playercount.json +#curl -X 'GET' 'http://lostarkchc.herokuapp.com/server/all' -H 'accept: application/json' > /tmp/lostark/all.json + +SERVER_CALVASUS=$(cat /tmp/lostark/calvasus.json | sed -e 's/{"status":200,"data":{"//g' -e 's/":".*/\n/g') +STATUS_CALVASUS=$(cat /tmp/lostark/calvasus.json | sed -e 's/{"status":200,"data":{"Calvasus":"//g' -e 's/"}}/\n/g') + +PLAYERCOUNT=$(cat /tmp/lostark/playercount.json | sed -e 's/{"status":200,"data":{"player_count"://g' -e 's/}}/\n/g') + +/home/debian/discordbot/discord.sh \ + --title "Lost Ark Server Status" \ + --color "0xFF8C00" \ + --url "https://www.playlostark.com/fr-fr/support/server-status" \ + --thumbnail "https://i.imgur.com/nOWkOD7.png" \ + --field "Serveur;$SERVER_CALVASUS" \ + --field "Statut;$STATUS_CALVASUS" \ + --field "Nombre de joueurs IG;$PLAYERCOUNT;false" \ + --footer "Demonic#3116" \ + --timestamp