The Engagement 4Cast
import sys def send_message_to_slack(text):
from urllib import request, parse
import json
post = {"text": "{0}".format(text)}
try:
json_data = json.dumps(post)
req = request.Request("Your Slack URL goes here",
data=json_data.encode('ascii'),
headers={'Content-Type': 'application/json'})
resp = request.urlopen(req)
except Exception as em:
print("EXCEPTION: " + str(em)) if len(sys.argv) < 1:
print("you did not give any argumentsn")
else:
send_message_to_slack(sys.argv[1:])
4Site Interactive Studios is a talented troupe of web professionals who are passionate about creating tools to support digital marketers. We love to hear from our community! Reach out to us with your thoughts and questions. And don’t forget to subscribe below to get notified when we post new blogs – no spam, just content👍🏼
Subscribe & stay ahead of the crowd with sage marketing tips and predictions.