Created
August 11, 2016 14:01
-
-
Save Koroeskohr/c0806038cfdd035f42ea33120aab7812 to your computer and use it in GitHub Desktop.
slack notification
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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