Skip to content

Instantly share code, notes, and snippets.

@Koroeskohr
Created August 11, 2016 14:01
Show Gist options
  • Save Koroeskohr/c0806038cfdd035f42ea33120aab7812 to your computer and use it in GitHub Desktop.
Save Koroeskohr/c0806038cfdd035f42ea33120aab7812 to your computer and use it in GitHub Desktop.
slack notification
require 'net/http'
require 'uri'
user = "votre_username"
uri = URI.parse("https://<group>.slack.com/services/hooks/slackbot?token=<token>&channel=%40#{user}")
request = Net::HTTP::Post.new(uri)
request.body = "votre_message"
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
http.request(request)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment