Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@gsherman
Created September 19, 2014 15:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gsherman/912d0ffe8738153020a7 to your computer and use it in GitHub Desktop.
Save gsherman/912d0ffe8738153020a7 to your computer and use it in GitHub Desktop.
post a message to a hipchat room
@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