Skip to content

Instantly share code, notes, and snippets.

@jbodah
Created May 6, 2016 18:09
Show Gist options
  • Select an option

  • Save jbodah/11a0684aa4ef5d190c0849ce4b00eb1b to your computer and use it in GitHub Desktop.

Select an option

Save jbodah/11a0684aa4ef5d190c0849ce4b00eb1b to your computer and use it in GitHub Desktop.
say_hipchat
#! /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