Skip to content

623524718/HostlocAutoGetPoints

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 

Repository files navigation

HostlocAutoGetPoints

此代码是在inkuang大佬的基础上稍作改变,增加了TG推送。目前原库已GG,感谢MJJ的贡献

推送结果

image

因为发现TG机器人推送内容包含'xxx.xxx.xxx.xxx'时会推送失败,故改为'xxx,xxx,xxx,xxx'以英文逗号形式输出ip地址。

Actions secrets 设置

'HOSTLOC_USERNAME' 用户名,多个用','英文逗号隔开

'HOSTLOC_PASSWORD' 密码,多个用','英文逗号隔开,与用户名一一对应,不对应和上下数量不一致会报错。

'BOT_API' TG机器人的API

'CHAT_ID' 你自己的chat_id

API 在@BotFather申请,chat_id可以通过机器人@userinfobot发送任意消息获取,返回的id即是chat_id

建议搬到私人库自己使用

image

image

Action workflow设置

image

image

image

左边的删除,然后写入

name: 'HostlocAutoGetPoints'

on:
  push:
    branches: 
      - main
  schedule:
    - cron: '0 16 * * *'

jobs:
  get_points:
    runs-on: ubuntu-latest
    steps:
    - name: 'Checkout codes'
      uses: actions/checkout@v2
    - name: 'Set python'
      uses: actions/setup-python@v1
      with:
        python-version: '3.x'
    - name: 'Install dependencies'
      run: python -m pip install --upgrade requests pyaes
    - name: 'Get points'
      env:
        HOSTLOC_USERNAME: ${{ secrets.HOSTLOC_USERNAME }}
        HOSTLOC_PASSWORD: ${{ secrets.HOSTLOC_PASSWORD }}
        BOT_API: ${{ secrets.BOT_API }}
        CHAT_ID: ${{ secrets.CHAT_ID }}
      run: python HostlocGetPoints.py

image

设置好Actions secrets后就可以在Action中运行了。如不运行在库中进行任意提交触发Action即可

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages