Skip to content

Instantly share code, notes, and snippets.

@MGallow
Created October 14, 2016 20:54
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 MGallow/488f7df288701ad8bef7cf0a8f8b71ae to your computer and use it in GitHub Desktop.
Save MGallow/488f7df288701ad8bef7cf0a8f8b71ae to your computer and use it in GitHub Desktop.
Let Slack notify you when your script is finished running!
# This is a simple script that will allow Slack to notify you when your script is finished running.
# Specifically, you will receive a message that says: "Script Complete".
# But first, you need to generate a Slack token.
# See here: https://api.slack.com/tokens
from slacker import Slacker
Token = "PLACE TOKEN HERE"
slack = Slacker(Token)
# Send a message to #CHANNEL.
# Adjust CHANNEL and USERNAME to suit your needs.
# Be sure that this line is placed at the end of your script.
message = slack.chat.post_message('#CHANNEL',"@USERNAME Script Complete", as_user = False)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment