#! /usr/bin/ruby | |
# -*- encoding: utf-8 -*- | |
require 'json' | |
require "net/https" | |
WH_URI = "https://hooks.slack.com/services/~~~~~~~~~~~~~~~~~~" | |
hashO = { | |
"text" => "また git com を実行しました。", | |
"icon_emoji" => ":sadpanda:", | |
"username" => "git com", | |
"channel" => "#nona-kanshi", | |
} | |
hash = "payload=" + hashO.to_json | |
uri = URI.parse(WH_URI) | |
https = Net::HTTP.new(uri.host, uri.port) | |
https.use_ssl = true | |
req = Net::HTTP::Post.new(uri.request_uri) | |
req.body = hash | |
res = https.request(req) | |
puts "this \`com\` is reported to Slack" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This comment has been minimized.
[alias]
com = !/home/nona/.dotfiles/bin/com.rb