send camera snapshot
Posted: Thursday 07 March 2024 21:26
I'm trying to send a notification in Telegram with a snapshot from a camera.
I can't do it at all.
I can't do it at all.
Code: Select all
#!/bin/sh
#FILE LOCATION
SnapFile="[LOCATION FOR TEMP STORAGE]"
#FETCH SNAPSHOT
wget "[URL TO GET SNAPSHOT]" -O $SnapFile
#SEND SNAPSHOT
curl -s -X POST "https://api.telegram.org/bot[APIKEY]/sendPhoto" -F chat_id=[CHATID] -F photo="@$SnapFile"
#REMOVE FILE
rm $SnapFile