All Projects → yzs981130 → autoSubmit

yzs981130 / autoSubmit

Licence: other
北京大学疫情出入校自动填报

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to autoSubmit

universe2021
All things GitHub Universe 2021!
Stars: ✭ 112 (+138.3%)
Mutual labels:  github-actions
sokoban-action
Sokoban game using GitHub Actions 🤖
Stars: ✭ 26 (-44.68%)
Mutual labels:  github-actions
drupal9ci
One-line installers for implementing Continuous Integration in Drupal 9
Stars: ✭ 137 (+191.49%)
Mutual labels:  github-actions
yamllint-action
Lints yaml files and annotates every finding.
Stars: ✭ 12 (-74.47%)
Mutual labels:  github-actions
git-actions
A GitHub Action to run arbitrary git commands
Stars: ✭ 72 (+53.19%)
Mutual labels:  github-actions
composer-install
A GitHub Action to streamline installation of PHP dependencies with Composer.
Stars: ✭ 151 (+221.28%)
Mutual labels:  github-actions
overview
Automate your workflows with GitHub actions for MATLAB.
Stars: ✭ 40 (-14.89%)
Mutual labels:  github-actions
megalinter
🦙 Mega-Linter analyzes 48 languages, 22 formats, 19 tooling formats, excessive copy-pastes, spelling mistakes and security issues in your repository sources with a GitHub Action, other CI tools or locally.
Stars: ✭ 534 (+1036.17%)
Mutual labels:  github-actions
deploy-to-cocoapods-github-action
Github action for deploying to Cocoapods.org
Stars: ✭ 29 (-38.3%)
Mutual labels:  github-actions
helm-gh-pages
A GitHub Action for publishing Helm charts to Github Pages
Stars: ✭ 60 (+27.66%)
Mutual labels:  github-actions
vsce-action
A GitHub Action to automate deploying VS Code extensions
Stars: ✭ 74 (+57.45%)
Mutual labels:  github-actions
gajira
GitHub Actions for Jira
Stars: ✭ 100 (+112.77%)
Mutual labels:  github-actions
dart-package-analyzer
GitHub Action that uses the Dart Package Analyzer to compute the Pub score of Dart/Flutter packages
Stars: ✭ 44 (-6.38%)
Mutual labels:  github-actions
pull-request-comment-branch
A GitHub Action to get the head ref and sha of a pull request comment
Stars: ✭ 21 (-55.32%)
Mutual labels:  github-actions
github-actions-templates
Starter GitHub Actions templates to get you up and running with community built integrations
Stars: ✭ 44 (-6.38%)
Mutual labels:  github-actions
github-docker
⚓ Build and publish your repository as a Docker image and push it to GitHub Package Registry in one step.
Stars: ✭ 33 (-29.79%)
Mutual labels:  github-actions
addtobasic.github.io
CUI Portfolio like ubuntu terminal.
Stars: ✭ 18 (-61.7%)
Mutual labels:  github-actions
perseverance
Make your functions 💪 resilient and 🚥 fail-fast to 💩 failures or ⌚ delays
Stars: ✭ 12 (-74.47%)
Mutual labels:  github-actions
action-autotag
Automatically generate a new tag when the manifest file (package.json, Dockerfile, custom file, etc) version changes.
Stars: ✭ 45 (-4.26%)
Mutual labels:  github-actions
bake-action
GitHub Action to use Docker Buildx Bake as a high-level build command
Stars: ✭ 52 (+10.64%)
Mutual labels:  github-actions

autoSubmit

Go

本项目通过读取环境变量中的学号和密码,依次执行:

  • 登录portal获取portalToken
  • 通过token登录portal获取cookie
  • 带着cookie访问出入校报备,获取simsoToken
  • 通过simsoToken登录simso系统,获取sid
  • 带着sid访问出入校报备小程序并填报

usage

强烈建议使用自动执行

github actions 自动执行

配置文件在go.yml,目前配置为每天北京时间8点执行一次。

github actions 配置

  • fork本项目
  • 在自己的repo下Settings/Secrets中设置USERNAME和PASSWORD,分别为学号和密码
  • 由于出入校报备变严,还需要设置REASON和TRACK,分别为出入校事由详细描述和行动路径
  • 【可选】如果需要微信通知,可以配置FT_SCKEY,为ftqq微信推送服务中的SCKEY
  • fork的项目会默认关闭actions,需手动点击repo页的actions以enable

local run

build

建议使用go >= 1.13

git clone https://github.com/yzs981130/autoSubmit.git
cd autoSubmit
go build

run

环境变量方法设置参数
  • 环境变量USERNAME:学号
  • 环境变量PASSWORD:密码
  • 环境变量REASON: 出入校事由详细描述
  • 环境变量TRACK: 行动路径
  • 环境变量FT_SCKEY:SCKEY
USERNAME=xxx PASSWORD=xxx REASON=xxx TRACK=xxx FT_SCKEY=xxxxxxxxx ./autosubmit

其中FT_SCKEY配置可选,配置会有

命令行传参设置
$ ./autosubmit -h
Usage of ./autosubmit:
  -password string
    	portal密码
  -reason string
    	出入校事由详细描述
  -reasonxx string
      出入校事由 (default "科研")
  -track string
    	出校行动轨迹
  -username string
    	学号
./autosubmit -username=1900012345 -password=dashabi -reason "" -track "康博斯-CBD-公主楼"

注意环境变量只能传USERNAMEPASSWORD,其他参数需要用命令行参数传,如果同时设置USERNAMEPASSWORD的环境变量和参数,命令行参数优先

如果成功,会显示如下log:

portal登录成功
simso登录成功
出校备案成功
微信通知发送成功
入校备案成功
微信通知发送成功

如果未配置FT_SCKEY则无微信通知发送成功字样,与上述log不同则可能失败,请在issue中反馈;后续也可能会添加debug信息和错误处理

TODO

热烈欢迎pr!!

  • error handling
  • code structure refactor
  • unit test
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].