Skip to content

Instantly share code, notes, and snippets.

@amankharwal
Created Sep 19, 2020
Embed
What would you like to do?
def send_slack(transcript,filename,keyword):
try:
response = requests.post( url="https://hooks.slack.com/services/ABCDEFG/123456/ABC123",
headers={
"Content-Type": "application/json",
},
data=json.dumps({
"text": "*Audio:* https://storage.cloud.google.com/" + BucketName + "/" + filename + "\n*Transcription:*\n" + transcript
})
)
print('Response HTTP Status Code: {status_code}'.format(
status_code=response.status_code))
print('Response HTTP Response Body: {content}'.format(
content=response.content))
except requests.exceptions.RequestException:
print('HTTP Request failed')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment