这是indexloc提供的服务,不要输入任何密码
Skip to content

使用浙大钉/爬虫获取课程/考试/分数信息,使用ical格式在 Windows/macOS/Linux/Android/Harmony OS/iOS/iPadOS/watchOS/Wear OS 上方便地访问日历

License

Notifications You must be signed in to change notification settings

cxz66666/zju-ical

Repository files navigation

ugrsical

Parse ZJU ugrs class timetable and generate iCalender file for you. If you are grs student, please use this repo.

How to use

we provide two binary file, ugrsical and ugrsicalsrv, both of them are same function, but one is running on your machine but the other is running on server and expose web page.

use ugrsical(local)

  • download from release page
  • don't need to edit configs
  • use ./ugrsical -u [userId] -p [password] to generate
  • also can use ./ugrsical --help to find advanced usage

use ugrsicalsrv(server)

  • download from release page

  • edit configs/server.json

    here is the fields description

    {
      "enckey": "D*F-JaNdRgUkXp2s5v8y/B?E(H+KbPeS",//aes key(must be 128bits or 192bits or 256bits)"
      "host": "localhost", //host path(localhost or your server domain)
      "port": 3000, //must be number
      "config": "configs/config.json", //path to config.json, can be empty(default)
      "ip_header": "", //if you use nginx as reverse proxy, you can set field ip-header to track real ip
      "redis_addr": "",//can be empty(default)
      "redis_pass": "" //can be empty(default)
    }
  • use ./ugrsicalsrv and open host::port to use!

More configs

  • we provide three config file under /configs: upfile.json, config.json, server.json

  • upfile.json is used for ugrsical to get username and password from file

  • config.json is used for ugrsical and ugrsicalsrv to get generated config, which is highly recommended not to modify, but if you are not satisfied with the generated config, you can modify it with follow rules:

    {
    "lastUpdated": 20220913, //just a flag
    "tweaks": [   //some holidays for zju course schedule changed
      {
        "TweakType": 2, //0:clear,1:copy,2:exchange
        "Description": "[国庆节] 放假调休,课程对调", //description
        "From": 20221006, //format YYYYMMDD
        "To": 20221008 
      },
    ],
    "termConfigs": [ // detailed term informations
      {
        "Year": "2022-2023",
        "Term": 0, // see pkg/zjuservice/class.go for details
        "Begin": 20220912,
        "End": 20221106,
        "FirstWeekNo": 1
      },
      {
        "Year": "2022-2023",
        "Term": 1,
        "Begin": 20221107,
        "End": 20230111,
        "FirstWeekNo": 1
      }
    ],
    "classTerms": [ //want query class terms, must be in termConfigs
      "2022-2023:0",//see pkg/zjuservice/class.go for details
      "2022-2023:1"
    ],
    "examTerms": [ // want query exam terms, must be in termConfigs
      "2022-2023:0"  //0 is fall and winter term, 1 is spring and summer term
    ]
    }
  • server.json is used for ugrsicalsrv to get server config, which is must modified for yourown server

  • anyway, please don't move config file to another path(which is hard code!)

Disclaimer

该项目仅供学习交流使用,作者不对产生结果正确性与时效性做实时保证,使用者需自行承担因程序逻辑错误或课程时间变动导致的后果。

About

使用浙大钉/爬虫获取课程/考试/分数信息,使用ical格式在 Windows/macOS/Linux/Android/Harmony OS/iOS/iPadOS/watchOS/Wear OS 上方便地访问日历

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 84.4%
  • HTML 10.6%
  • Makefile 2.7%
  • CSS 1.4%
  • Other 0.9%