Created
September 19, 2014 15:33
-
-
Save gsherman/912d0ffe8738153020a7 to your computer and use it in GitHub Desktop.
post a message to a hipchat room
This file contains 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
@echo off | |
set Count=0 | |
for %%a in (%*) do set /a Count+=1 | |
echo %Count% | |
if %count% NEQ 2 goto usage | |
c: | |
cd C:\Dovetail\RuleManagerActions\Hipchat | |
SET room=%1 | |
SET message=%2 | |
SET token=mySecretTokenGoesHere | |
SET json='{ "message": %message%, "message_format":"text" }' | |
:sendMessage | |
curl -k -H 'Content-Type: application/json' -d %json% https://api.hipchat.com/v2/room/%room%/notification?auth_token=%token% | |
goto done | |
:usage | |
echo. | |
echo Invalid usage | |
echo Usage: hipchat-message roomNameOrId message | |
echo. | |
:done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment