Skip to content

Commit

Permalink
A push_impl.wework.sh: add backend wework impl
Browse files Browse the repository at this point in the history
  • Loading branch information
yurenchen000 committed Oct 26, 2024
1 parent 71a62c3 commit f695876
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions push_impl.wework.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@

## --------- push via feishu bot

## need conf
# WEWORK_BOT_KEY=

## msg is markdown //also support text (via text.content)
do_push_wework(){
local tit="$1"
local msg="$2"

curl -s "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=$WEWORK_BOT_KEY" \
-H "Content-Type: application/json" \
-d @- <<-EOF
{
"msgtype": "markdown",
"markdown": {
"title": "$tit",
"text": "**== $tit ==** \n$msg"
}
}
EOF

echo
# echo "==`date -Is`: $tit: $msg" >&2
}

## note: this file indent need to be tabs, cause bash here-doc
## wework can't send to wechat
## msg formats: https://developer.work.weixin.qq.com/document/path/99110#markdown%E7%B1%BB%E5%9E%8B


0 comments on commit f695876

Please sign in to comment.