Skip to content

Commit

Permalink
Merge branch 'yuzhi535:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
yuxuenuanyang authored Jun 8, 2022
2 parents b9b0ba2 + 0dde64b commit 7973a24
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,15 @@

- 城市的name必须是city,value是上面链接对应数字的第三、四位
- 详细地址就没有要求,但是name必须是position
- name是myvs_26,对应的是疫苗接种情况,具体填法如下(若无该项,则默认接种第二针)

| 需填值 |含义 |
| ---- | ---- |
| 1 | 已接种第1针 |
| 2 | 已接种第2针 |
| 3 | 尚未接种 |
| 4 | 有禁忌症,无法接种 |
| 5 | 已接种第3针 |

4. 然后在左边的找到actions,选择enable action,这样就激活了action
5. 结束。接下来会每日6点、6点10分和7点、7点10分自动打卡(多次打卡防止打卡失败)。不过这里**第一次**建议自己修改 .github/workflows 里面的 jkdk.yml 里的时间以进行一次打卡看看效果(有时候会因为网络问题打卡失败,不过因为设置了**多次打卡**的缘故,失败的几率会降低),注意修改为**UTC时间**,即比北京时间晚8个小时,具体可以参考有北京时间注释的那一行。
Expand Down
5 changes: 3 additions & 2 deletions jkdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@


class Jkdk:
def __init__(self, uid, upw, key, province, city, position):
def __init__(self, uid, upw, key, province, city, position, myvs_26=None):
self.src = 'https://jksb.v.zzu.edu.cn/vls6sss/zzujksb.dll/login'
self.src2 = 'https://jksb.v.zzu.edu.cn/vls6sss/zzujksb.dll/jksb?ptopid={ptosid}&sid={sid}&fun2='

Expand Down Expand Up @@ -36,6 +36,7 @@ def __init__(self, uid, upw, key, province, city, position):
self.form2 = {}
self.form1 = {}
self.fun18 = ''
self.myvs_26 = myvs_26 if myvs_26 else '2'

def encode(self, page):
text = page.text.encode(page.encoding).decode(page.apparent_encoding)
Expand Down Expand Up @@ -193,7 +194,7 @@ def get_form2(self, text, label: str, attrs: dict):
self.form2["myvs_13a"] = self.province
self.form2["myvs_13b"] = self.city
self.form2["myvs_13c"] = self.position
self.form2['myvs_26'] = '2'
self.form2['myvs_26'] = self.myvs_26
self.form2['did'] = '2'
self.form2['men6'] = 'a'
self.form2['fun18'] = self.fun18
Expand Down
3 changes: 2 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
city = os.environ.get('city')
position = os.environ.get('position')
city = province+city
myvs_26 = os.environ.get('myvs_26')


print(f'username={username}')
Expand All @@ -28,5 +29,5 @@
if key == '':
key = None
m = Jkdk(username, password, key, province=province,
city=city, position=position)
city=city, position=position, myvs_26=myvs_26)
m.jkdk()

0 comments on commit 7973a24

Please sign in to comment.