Skip to content

Commit

Permalink
socre -> score
Browse files Browse the repository at this point in the history
  • Loading branch information
6r6 authored and d8b committed Feb 13, 2019
1 parent d64a3b9 commit dabefe9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

### 预览一下?

> 作者不会收集任何人的信息。代码是开源的,最好自行部署较为放心。
> 作者不会收集任何人的信息。代码是开源的,最好自行部署较为放心。写码的时候成绩还未公布,页面结构未知,所以如果查询成功,结果是含有成绩的页面而不是JSON格式。
请求方式:GET

Expand Down
10 changes: 5 additions & 5 deletions index.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/usr/bin/env python3
# !/usr/bin/env python3
# -*- coding: utf-8 -*-
# 6r6

import os
import time
Expand All @@ -20,7 +19,7 @@
secret_key = os.environ.get('secret_key')

# Server酱V3配置
sckey = ''
sckey = os.environ.get('sckey')

logger = logging.getLogger()

Expand Down Expand Up @@ -61,7 +60,7 @@ def get_text(self, image_raw):
else:
return '0'

class SocreQuery:
class ScoreQuery:

def __init__(self, xm, id, ksbh):
self.xm = xm
Expand Down Expand Up @@ -138,7 +137,7 @@ def main_handler(event, context):
xm = event['queryString']['xm']
id = event['queryString']['id']
kh = event['queryString']['kh']
query = SocreQuery(xm,id,kh)
query = ScoreQuery(xm,id,kh)
page = query.get_score_page()
if '无查询结果' in page:
logging.info('成绩还没出')
Expand All @@ -150,6 +149,7 @@ def main_handler(event, context):
data['headers']['Content-Type'] = 'text/html'
data['body'] = score_content
#query.notice(sckey,'成绩出了',page)
#写这段代码的时候,成绩还未公布,并不知道页面结构,所以直接返回表格内容
return data
else:
data['body'] = json.dumps({"Code":103,"Msg":"Unexpected page contents","Request_id":rid})
Expand Down

0 comments on commit dabefe9

Please sign in to comment.