Post from Python to Slack

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

スクリーンショット-2016-02-29-12.16.jpg

Click on the image to launch the browser.

t_スクリーンショット 2016-02-29 12.16.38.jpg

Click Build your own.

t_スクリーンショット 2016-02-29 12.17.03.jpg

Click Make a Untara.

t_スクリーンショット 2016-02-29 12.17.15.jpg

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

Post from Python to Slack
Post to vim → Python → Slack
Post to slack with Python 3
Post to Slack in Python
Post from python to facebook timeline
[Lambda] [Python] Post to Twitter from Lambda!
Post images from Python to Tumblr
Changes from Python 3.0 to Python 3.5
Changes from Python 2 to Python 3.0
Send a message from Python to Slack
Post a message from IBM Cloud Functions to Slack in Python
Send a message from Slack to a Python server
Image characters and post to slack (python slackbot)
Post to Slack via Subscriber
Cheating from PHP to Python
Anaconda updated from 4.2.0 to 4.3.0 (python3.5 updated to python3.6)
Post to Twitter using Python
Switch from python2.7 to python3.6 (centos7)
Connect to sqlite from python
Call Matlab from Python to optimize
Post Jenkins console output to Slack
Create folders from '01' to '12' with python
Connect to utf8mb4 database from python
Post to slack in Go language
Python (from first time to execution)
How to access wikipedia from python
Python to switch from another language
Easily post to twitter with Python 3
[Nanonets] How to post Memo [Python]
Did not change from Python 2 to 3
Update Python on Mac from 2 to 3
[Python] Fluid simulation: From linear to non-linear
Updated to Python 2.7.9
From Python to using MeCab (and CaboCha)
How to update Google Sheets from Python
Private Python handbook (updated from time to time)
I want to use jar from python
Convert from katakana to vowel kana [python]
Push notification from Python server to Android
Sum from 1 to 10
sql from python
Log in to Slack using requests in Python
Connecting from python to MySQL on CentOS 6.4
Porting and modifying doublet-solver from python2 to python3.
How to access RDS from Lambda (python)
MeCab from Python
Python> Output numbers from 1 to 100, 501 to 600> For csv
Convert from Markdown to HTML in Python
[Amazon Linux] Switching from Python 2 series to Python 3 series
API explanation to touch mastodon from python
Connect to coincheck's Websocket API from Python
"Backport" to python 2
Edit Excel from Python to create a PivotTable
How to open a web browser from python
Study from Python Hour7: How to use classes
[Python] Convert from DICOM to PNG or CSV
Import Excel file from Python (register to DB)
I want to email from Gmail using Python.
[Python] I want to manage 7DaysToDie from Discord! 1/3
From file to graph drawing in Python. Elementary elementary
[First post] Question ・ How to sweep out python