After learning machine learning, I wanted to be notified of the result, so I looked it up and made a note.
Use Incoming Webhook. For more information, go to the Manual (https://api.slack.com/incoming-webhooks).
Really one liner.
Enter requests with pip.
import requests
import json
requests.post('URL copied above', data = json.dumps({
'text': u'Test', #Text to post
'username': u'me', #Post username
'icon_emoji': u':ghost:', #Emoji to put in the profile image of the post
'link_names': 1, #Enable mentions
}))
The list of emojis that can be used is here. You can also specify a profile image with ʻicon_url`.
Regarding link_names
, I secretly wrote it here.
Recommended Posts