# Ask user to enter the event_id here
echo 'Enter Event ID:'
read event_id
# Store into %URL%
url="https://www.rampagebots.co.uk/api/events/upcoming_battles?id=$event_id"

# Poll Rampage every 60 seconds for information
# The response from Rampage is cached for 60 seconds so changing the polling time to anything less than 60
# Won't achieve anything.

sleep_time=60

while true
do

battle= echo $(curl -LsN $url -H "Accept: application/json" -H "Content-Type: application/json" | jq -r .nextBattles[0] > next_battle.txt)

echo "Next Battle Is:"
cat next_battle.txt
echo "Polling again in $sleep_time seconds"
sleep $sleep_time
done