The message can be pre-defined or passed to it on the flight.īack to the situations I talked about at the beginning, how this Flask app can solve the problems? Now you have a Flask app to send you message whenever it gets a HTTP request. Upload the Flask app to Google App Engine: gcloud app deploy.Create a route handler in Flask app and make it be able to make GET request to send message like below: $TOKEN/sendMessage?chat_id=12345&text=Hello+World.Talk with your bot and get the chat id: $TOKEN/getUpdates.Follow Google App Engine tutorial to build a basic Flask app.The steps to build this Flask app can be found below: This Flask app can be running in Google App Engine for free, and use your custom domain. The solution to above situations is a mechanism to send message to your phone programmatically and here is my solution:īuild a Flask app to receive GET or POST request, and then compose different messages according to event type and send to some chat channel such as Telegram or Slack. I want get notified when a scraper or job finished.I want to get notified when there is new visit to my website.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |