Skip to content

Commit

Permalink
ssss
Browse files Browse the repository at this point in the history
  • Loading branch information
1zhangluo1 committed Mar 5, 2024
0 parents commit 7b2a15b
Show file tree
Hide file tree
Showing 9 changed files with 121 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/run_script.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Run Script at 15:20 UTC

on:
schedule:
# - cron: '20 15 * * *' # 每天 UTC 时间 15:20 执行
- cron: '59 13 * * *'
- workflow_dispatch:

jobs:
run_script:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.x # 更改为你的 Python 版本

- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
pip install requests
- name: Run Python script
run: python3 main.py # 更改为你的脚本路径
3 changes: 3 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions .idea/KexieAutoSign.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

53 changes: 53 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import datetime
import sys
import time

import requests

student_ID = 2300320225

def post_http(jsonBody, uriAdress):
response = requests.post(uriAdress, json= jsonBody)
print(response.text)

def sign_out(student_ID):
body = {'userId': student_ID}
post_http(body, 'https://at.kexie.space/api/user/signOut')

def sign_in():
body = {'userId': student_ID}
response = requests.post('https://at.kexie.space/api/user/signIn', json= body)
print(response.text)

def find_target_is_online():
response = requests.get(f'https://at.kexie.space/api/record/online/{student_ID}')
temp = response.json()
online = temp['data']['status']
return online

sign_out(student_ID)

# def auto_sign_out():
# now_time = time.strftime('%H:%M:%S', time.localtime())
# print(now_time)
# target_time = '23:20:00'
# if now_time == target_time:
# if find_target_is_online(student_ID) == 1:
# sign_out(student_ID)
# else: print('当前不在线,不用签退')
# else: print('还未到时间')

# print("选择功能:\n")
# print('1.签到\n2.签退\n3.查看当前在线状态\n4.开启11点半前自动签退')
# num = input('输入序号选择功能:')
# if num == 1:
# sign_in()
# elif num == 2:
# sign_out()
# elif num == 3:
# find_target_is_online()
# elif num == 4:
# auto_sign_out()
# else:
# print('输入异常,程序退出')
# sys.exit(1)
Binary file added msedgedriver.exe
Binary file not shown.

0 comments on commit 7b2a15b

Please sign in to comment.