Skip to content

Commit

Permalink
同步消息接口更新
Browse files Browse the repository at this point in the history
  • Loading branch information
cuxt committed Aug 18, 2024
1 parent 0580e6a commit 8759e52
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/189_cloud_check_in.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ jobs:
- name: 'Run script'
env:
TY_CLOUD: ${{ secrets.TY_CLOUD }}
TOKEN: ${{secrets.TOKEN}}
run: python 189/cloud_check_in.py
10 changes: 9 additions & 1 deletion 189/cloud_check_in.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,14 +164,22 @@ def check_in(username, password):


def send_msg(message, action="qywx", webhook="H", msg_type="text", url="https://api.xbxin.com/msg"):
env = Env()
env.read_env()
token = env.str("TOKEN")

headers = {
'Authorization': f'Bearer {token}',
}

data = {
"message": message,
"action": action,
"webhook": webhook,
"msg_type": msg_type,
}

requests.post(url, json=data)
requests.post(url, json=data, headers=headers)


def main():
Expand Down
10 changes: 9 additions & 1 deletion 189/ctyun.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,22 @@ def keep_alive(ctyun, user_data, retries=3, delay=10):


def send_msg(message, action="qywx", webhook="H", msg_type="text", url="https://api.xbxin.com/msg"):
env = Env()
env.read_env()
token = env.str("TOKEN")

headers = {
'Authorization': f'Bearer {token}',
}

data = {
"message": message,
"action": action,
"webhook": webhook,
"msg_type": msg_type,
}

requests.post(url, json=data)
requests.post(url, json=data, headers=headers)


def sha256(password):
Expand Down

0 comments on commit 8759e52

Please sign in to comment.