Created
December 5, 2015 01:08
-
-
Save zosiu/4e78055fbdc1e78f4b71 to your computer and use it in GitHub Desktop.
Hipchat status change
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
#!/bin/bash | |
# usage: critical_hit HIPCHAT_API_KEY HIPCHAT_USER_ID_OR_EMAIL | |
(./set_hipchat_status $1 $2 dnd; sleep 2h; ./set_hipchat_status $1 $2 chat) & |
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
#!/bin/bash | |
# usage: set_hipchat_status HIPCHAT_API_KEY HIPCHAT_USER_ID_OR_EMAIL STATUS | |
# status can be one of the following: chat away dnd | |
RES=$(curl -s -H "Content-type: application/json" -H "Authorization: Bearer $1" -X GET https://api.hipchat.com/v2/user/$2 | sed 's/"show": \("chat"\|"away"\|"dnd"\)/"show": "'"$3"'"/') | |
curl -s -H "Content-type: application/json" -H "Authorization: Bearer $1" -X PUT -d "$RES" https://api.hipchat.com/v2/user/$2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I could not make it work 😢
https://github.com/craig-gomes/hipchat-rb/commits/master fork sounds like a decent alternative