Created
June 4, 2014 13:31
-
-
Save iktakahiro/cbce69388bf47f21d06b to your computer and use it in GitHub Desktop.
cURL(curlコマンド)でHipChatにメッセージを送る ref: http://qiita.com/iktakahiro/items/e431ca97f368832e6feb
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 | |
BASE_URI="https://api.hipchat.com" | |
API_VERSION="v1" | |
# Notification権限を持つAPIトークンを記載します | |
API_TOKEN=**************** | |
COMMON_URI=${BASE_URI}/${API_VERSION} | |
COMMON_PARAMETER="format=json&auth_token=${API_TOKEN}" | |
# ROOM_IDです | |
ROOM_ID=777 | |
# 投稿者名です | |
FROM="Shell Script" | |
# 本文です | |
MESSAGE="--- お邪魔します。---" | |
# curlコマンド | |
curl ${COMMON_URI}/rooms/message?${COMMON_PARAMETER} -X POST -d "room_id=${ROOM_ID}&from=${FROM}&message=${MESSAGE}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment