Created
August 14, 2014 01:18
-
-
Save jtadeulopes/2cda8f9f5364490a557f to your computer and use it in GitHub Desktop.
Revisions
-
jtadeulopes created this gist
Aug 14, 2014 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,18 @@ require 'httparty' class SlackRuby include HTTParty base_uri 'slack.com/api' def initialize(token) @token = token end def post_message(args) options = { query: args.merge!(token: @token) } self.class.post('/chat.postMessage', options) end end slack = SlackRuby.new('slack-token-api') puts slack.post_message(channel: 'channel-id', text: 'Oi :)')