Created
November 6, 2019 21:28
-
-
Save Ksisu/385497d9b75eb58b6987ef7831070c50 to your computer and use it in GitHub Desktop.
bash function for send message to zulip
This file contains hidden or 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 | |
source /home/__TODO__/.bashrc # only need if use from cron | |
ZULIP_MESSAGES_API="https://__TODO__/api/v1/messages" | |
ZULIP_BOT_EMAIL_ADDRESS="__TODO__" | |
ZULIP_BOT_API_KEY="__TODO__" | |
ZULIP_STREAM="DevOps Technical" | |
ZULIP_TOPIC="(no topic)" | |
function zulipSend { | |
curl -s -X POST $ZULIP_MESSAGES_API \ | |
-u $ZULIP_BOT_EMAIL_ADDRESS:$ZULIP_BOT_API_KEY \ | |
-d "type=stream" \ | |
-d "to=$ZULIP_STREAM" \ | |
-d "subject=$ZULIP_TOPIC" \ | |
-d $"content=$1" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment