Skip to content

Instantly share code, notes, and snippets.

@hrysd
Created August 21, 2012 05:53
Show Gist options
  • Save hrysd/3412377 to your computer and use it in GitHub Desktop.
Save hrysd/3412377 to your computer and use it in GitHub Desktop.
deploy時にLingrに通知をおくる。
require 'open-uri'
require 'digest/sha1'
ROOM = '部屋の id'
ID = 'bot の id'
SECRET = 'bot の secret'
VERIFIER = Digest::SHA1.hexdigest(ID + SECRET)
TEXT = "deployしました"
namespace :notification do
task :lingr do
open("http://lingr.com/api/room/say?room=#{ROOM}&bot=#{ID}&text=#{URI.escape(TEXT)}&bot_verifier=#{VERIFIER}") { |io| io.read }
end
end
after :deploy, 'notification:lingr'
@hrysd
Copy link
Author

hrysd commented Aug 21, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment