Notifications server routine

If doesn't fit into any other category ....
Post Reply
peridot
Posts: 46
Joined: Mon Mar 08, 2021 4:54 am
Has thanked: 7 times
Been thanked: 93 times

Notifications server routine

Post by peridot »

Here is a simple free notification server to use with your projects. The server ntfy allows you to sent http get messages under a topic (which is also effectively your password), you can add extra fields for tags, titles, priority etc as shown in the code below.
The app is available for IOS and Android.
Screenshot (31 Jan 2024 4 27 30 pm) (Small).png

Code: [Local Link Removed for Guests]

ONWGETASYNC answer_done

'msg$="message=Reboot"
'msg$="message=Rain-watering%20Off"
'msg$="message=Fault-Watering%20Off"
msg$="message=Status-All%20OK"
ext$="&title=Water%20Irrigation&priority=3&tags=warning"
notify "ntfy.sh","/annex2024/publish?"+msg$+ext$
wait


'Send push notification to ntfy
sub notify(servaddr$,tcpreq$
  local get$
  get$=servaddr$+tcpreq$
  wlog get$
 WGETASYNC(get$, 80)
End sub

answer_done:
wlog WGETRESULT$
Return
You do not have the required permissions to view the files attached to this post.
User avatar
cicciocb
Site Admin
Posts: 1995
Joined: Mon Feb 03, 2020 1:15 pm
Location: Toulouse
Has thanked: 428 times
Been thanked: 1335 times
Contact:

Re: Notifications server routine

Post by cicciocb »

Thanks for the information and the example code.
I usually use Telegram for that but is always good to have alternatives.
Post Reply