-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
A push_impl.wework.sh: add backend wework impl
- Loading branch information
1 parent
71a62c3
commit f695876
Showing
1 changed file
with
32 additions
and
0 deletions.
There are no files selected for viewing
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
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 | ||
|
||
|