Created
May 6, 2016 18:09
-
-
Save jbodah/11a0684aa4ef5d190c0849ce4b00eb1b to your computer and use it in GitHub Desktop.
say_hipchat
This file contains hidden or 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
| #! /usr/bin/env ruby | |
| require 'yaml' | |
| require 'hipchat' | |
| def config | |
| @config ||= YAML.load_file(File.expand_path File.join(__FILE__, '../.env.yml')) | |
| end | |
| def hipchat | |
| @hipchat ||= HipChat::Client.new(config["hipchat_access_token"], api_version: 'v2') | |
| end | |
| room = ARGV[0] | |
| message = ARGV[1..-1].join(' ') | |
| hipchat[room].send_message "IAMAROBOT! - #{message}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment