A test to post from Python to Slack. At the time of posting, my Slack name + BOT is attached, so the strategy to blame BOT for the description that can not read the place.
First from the Slack app
Click on the image to launch the browser.
Click Build your own.
Click Make a Untara.
Then click I coming WebHooks and select the URL to post. Paste to the saved URL in the script.
slackpost.py
#!/user/bin/env python
# -*- coding: utf-8 -*-
import requests
import json
while True:
post_words = raw_input(u"words?: ")
requests.post('Saved URL', data = json.dumps({
'text': post_words, #Text to post
'username': u'Post user name',
}))
It's a guy who starts from the terminal and goes around with While. It seems that I can play Slack in various ways, so I'm planning to graduate (give up) from playing with the Twitter API and try playing with Slack.
Recommended Posts