#!/bin/sh

resp=$(curl -s "https://api.pushover.net/1/messages.json?secret=$PUSHOVER_SECRET&device_id=$PUSHOVER_DEVICE")
cnt=$(echo $resp | jq '.messages | length')
latest=$(echo $resp | jq '.messages[-1].message')

echo -n "{\"text\": \"$cnt\", \"tooltip\": $latest, \"alt\": \"\", \"class\": \"\" }"
