Last active
June 1, 2018 02:16
-
-
Save hongta/e72c82bb3275d1a8fc3d1bb82eadf77a to your computer and use it in GitHub Desktop.
[pushover]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # source: http://forums.fast.ai/t/training-metrics-as-notifications-on-mobile-using-callbacks/17330 | |
| def send_notification(msg_string): | |
| ''' | |
| This function sends message to my mobile using Pushover. | |
| ''' | |
| import requests | |
| from datetime import datetime | |
| url = "https://api.pushover.net/1/messages.json" | |
| data = { | |
| 'user' : "<<YOUR_USER>", | |
| 'token' : "<<YOUR_TOKEN>>", | |
| 'sound' : "gamelan" | |
| } | |
| data['message'] = msg_string | |
| data['message'] = data['message'] + "\n" + str(datetime.now()) | |
| r = requests.post(url = url, data = data) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment