Skip to content

Instantly share code, notes, and snippets.

@satoshi03
Last active August 29, 2015 14:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save satoshi03/9e1148db4477eabb9733 to your computer and use it in GitHub Desktop.
Save satoshi03/9e1148db4477eabb9733 to your computer and use it in GitHub Desktop.
Slackにincoming webhook経由でpythonからメッセージをPOSTする ref: http://qiita.com/satoshi03/items/14495bf431b1932cb90b
> import slackweb
> slack = slackweb.Slack(url="<コピーしたURL>")
> slack.notify(text="This is a test.")
> slack.notify(text="This is a *test*.", channel="#coffee", username="coffee-bot", icon_emoji=":coffee", mrkdwn=True)
> attachments = []
> attachment = {"title": "Sushi",
"pretext": "Sushi _includes_ gunkanmaki",
"text": "Eating *right now!*",
"mrkdwn_in": ["text", "pretext"]}
> attachments.append(attachment)
> slack.notify(attachments=attachments)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment