Skip to content

Instantly share code, notes, and snippets.

@Ksisu
Created November 6, 2019 21:28
Show Gist options
  • Save Ksisu/385497d9b75eb58b6987ef7831070c50 to your computer and use it in GitHub Desktop.
Save Ksisu/385497d9b75eb58b6987ef7831070c50 to your computer and use it in GitHub Desktop.
bash function for send message to zulip
#!/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