

### Pushover

```bash
curl -s \
  --form-string "token=APP_TOKEN" \
  --form-string "user=USER_KEY" \
  --form-string "message=here is an image attachment" \
  -F "attachment=@image.jpg" \
  https://api.pushover.net/1/messages.json
```

```bash
# A ajouter dans .zshrc

function push {
    curl -s -F "token=YOUR_TOKEN_HERE" \
    -F "user=YOUR_USER_KEY_HERE" \
    -F "title=YOUR_TITLE_HERE" \
    -F "message=$1" https://api.pushover.net/1/messages.json
}
```

```bash
send_pushover_notification() {
	echo -e "Sending Pushover notification ..."
    curl -s -F "token=$BASH_APP" \
    -F "user=$USER_KEY" \
    -F "title=$1" \
    -F priority=2 \
		-F html=1 \
    -F retry=60 \
    -F expire=86400 \
    -F "message=$2" https://api.pushover.net/1/messages.json
    
    [ $? -eq 0 ] && echo -e "${greenbold}Pushover notification sent successfully !${reset}" || echo -e "${redbold}error sending Pushover notification !${reset}"
}
```

```bash
curl -s -F "token=$BASH_APP" -F "user=$USER_KEY" -F "title=Salut" -F "message=Bien" https://api.pushover.net/1/messages.json

# token: "API token" (Créer une application)
# user: "Your User Key"

# Message avec des tags HTML:
curl -s -F "user=$USER_KEY" -F "title=Great Title" -F "html=1" -F "token=$BASH_APP" -F "message='message<b> de</b> test'" https://api.pushover.net/1/messages.json
{"status":1,"request":"4b6b1655-1276-4c7d-932f-7baf0b93e5dc"}%

msg="'This is a <b>HTML</b> test'"
./pushover.sh -a "bash" -m "$msg" -f 1
```

```bash
# push a notification to your phone. can be handy if you're running a
# build and you want to be notified when it's finished.
push() {
    curl -s -F "token=PUSHOVER_TOKEN" \
    -F "user=PUSHOVER_USER" \
    -F "title=terminal" \
    -F "message=$1" https://api.pushover.net/1/messages.json > /dev/null 2>&1
}

command_to_run && push "yes! command finished successfully!" || push "awww man! something failed :-("
```

[send the IP of my Raspberry Pi via Pushover](https://gist.github.com/PJUllrich/e95baa0d718e55a6c67f85cd8e53dabe)



### nfty

```bash
curl -H "X-Priority: 4" -d "yo" https://notif.maboiteverte.fr/pihole
```



### gotify

```bash
send_gotify_notification() {
	now=$(date +"%d-%m-%Y %T")
	gotify_server="https://gotify.maboiteverte.fr"
	TITLE="Pi-hole on $host update"
	MESSAGE="**A new version of Pi-hole is available:**\n\n $msg_md\n\n $infos\n\n Please run *pihole -up* on $host to update !"
	PRIORITY=8
	URL="$gotify_server/message?token=$token_gotify&?format=markdown"
	
	echo -e "Sending notification to $gotify_server ..."
	
	curl -s -S --output /dev/null --data '{"message": "'"${MESSAGE}"'", "title": "'"${TITLE}"'", "priority":'"${PRIORITY}"', "extras": {"client::display": {"contentType": "text/markdown"}}}' -H 'Content-Type: application/json' "$URL"

	[ $? -eq 0 ] && echo -e "${greenbold}Gotify notification sent successfully !${reset}" || echo -e "${redbold}error sending Gotify notification !${reset}"
}
```

