Skip to content

Instantly share code, notes, and snippets.

@boffbowsh
Created April 5, 2017 10:25
Show Gist options
  • Save boffbowsh/fac07010490a15fa855deae43c5271c6 to your computer and use it in GitHub Desktop.
Save boffbowsh/fac07010490a15fa855deae43c5271c6 to your computer and use it in GitHub Desktop.
import urllib
import json
def lambda_handler(event, context):
json_text = json.dumps({
"text": "Tea is ready at Corestom",
"icon_url": "https://emoji.slack-edge.com/T026J8X3T/corestum/30c38516350c8fc6.png",
"username": "Corestom Teabot"
})
params = urllib.urlencode({'payload': json_text})
f = urllib.urlopen("<insert hook URL here>", params)
print f.read()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment