Skip to content

Instantly share code, notes, and snippets.

@zosiu
Created December 5, 2015 01:08
Show Gist options
  • Save zosiu/4e78055fbdc1e78f4b71 to your computer and use it in GitHub Desktop.
Save zosiu/4e78055fbdc1e78f4b71 to your computer and use it in GitHub Desktop.
Hipchat status change
#!/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) &
#!/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
@jmgarnier
Copy link

I could not make it work 😢

https://github.com/craig-gomes/hipchat-rb/commits/master fork sounds like a decent alternative

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment