Skip to content

Commit

Permalink
Replace hard-coded web hook url with environment variable
Browse files Browse the repository at this point in the history
  • Loading branch information
ueg1990 committed Apr 2, 2015
1 parent c115562 commit 4157ee8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion main.go
Expand Up @@ -112,7 +112,7 @@ func twiml(w http.ResponseWriter, r *http.Request) {
slack_name := val["slack_name"]
slack_profilepic := val["slack_profilepic"]
slack_msg := strings.Join(bodyArray[1:], " ")
resp, _ := http.Post("https://hooks.slack.com/services/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", "text/json", strings.NewReader("{\"text\": \""+slack_msg+"\", \"channel\" : \""+slack_channel+"\", \"username\" : \""+slack_name+"\", \"icon_url\":\""+slack_profilepic+"\"}"))
resp, _ := http.Post(os.Getenv("SLACK_WEARHACKS_WEBHOOK_URL"), "text/json", strings.NewReader("{\"text\": \""+slack_msg+"\", \"channel\" : \""+slack_channel+"\", \"username\" : \""+slack_name+"\", \"icon_url\":\""+slack_profilepic+"\"}"))
fmt.Println(resp.Status)
msg := "Responding..."
if resp.StatusCode >= 200 && resp.StatusCode < 300 {
Expand Down

0 comments on commit 4157ee8

Please sign in to comment.