mirror of
https://github.com/Sitoi/dailycheckin.git
synced 2024-11-17 13:48:03 +08:00
添加什么值得买签到
This commit is contained in:
parent
e4fe1db91c
commit
3e0ca69c89
1
.github/workflows/deploy_tencent_scf.yml
vendored
1
.github/workflows/deploy_tencent_scf.yml
vendored
@ -53,6 +53,7 @@ jobs:
|
||||
LIANTONG_ACCOUNT_LIST: ${{secrets.LIANTONG_ACCOUNT_LIST}}
|
||||
V2EX_COOKIE_LIST: ${{secrets.V2EX_COOKIE_LIST}}
|
||||
WWW2NZZ_COOKIE_LIST: ${{secrets.WWW2NZZ_COOKIE_LIST}}
|
||||
SMZDM_COOKIE_LIST: ${{secrets.SMZDM_COOKIE_LIST}}
|
||||
|
||||
- name: "部署到腾讯云函数"
|
||||
run: sls deploy --debug
|
||||
|
1
.github/workflows/main.yml
vendored
1
.github/workflows/main.yml
vendored
@ -51,3 +51,4 @@ jobs:
|
||||
LIANTONG_ACCOUNT_LIST: ${{secrets.LIANTONG_ACCOUNT_LIST}}
|
||||
V2EX_COOKIE_LIST: ${{secrets.V2EX_COOKIE_LIST}}
|
||||
WWW2NZZ_COOKIE_LIST: ${{secrets.WWW2NZZ_COOKIE_LIST}}
|
||||
SMZDM_COOKIE_LIST: ${{secrets.SMZDM_COOKIE_LIST}}
|
||||
|
@ -48,6 +48,7 @@
|
||||
|签到|联通营业厅|每日签到|每天一次|
|
||||
|签到|V2EX|每日签到|每天一次|
|
||||
|签到|咔叽网单|每日签到|每天一次|
|
||||
|签到|什么值得买|每日签到|每天一次|
|
||||
|羊毛|喜马拉雅极速版|金币获取|30分钟一次|
|
||||
|其他|百度站点|提交网站页面供百度收录|每天一次|
|
||||
|其他|每日天气预报|获取指定的多个城市天气信息|每天一次|
|
||||
|
@ -140,5 +140,13 @@
|
||||
{
|
||||
"www2nzz_cookie": "帐号2 cookie"
|
||||
}
|
||||
],
|
||||
"SMZDM_COOKIE_LIST": [
|
||||
{
|
||||
"smzdm_cookie": "账号1 cookie"
|
||||
},
|
||||
{
|
||||
"smzdm_cookie": "账号2 cookie"
|
||||
}
|
||||
]
|
||||
}
|
@ -25,6 +25,7 @@ if [[ $BILIBILI_COOKIE_LIST ]]; then echo "BILIBILI_COOKIE_LIST 变量存在,
|
||||
if [[ $LIANTONG_ACCOUNT_LIST ]]; then echo "LIANTONG_ACCOUNT_LIST 变量存在,并成功赋值" ;else LIANTONG_ACCOUNT_LIST=[]; fi;
|
||||
if [[ $V2EX_COOKIE_LIST ]]; then echo "V2EX_COOKIE_LIST 变量存在,并成功赋值" ;else V2EX_COOKIE_LIST=[]; fi;
|
||||
if [[ $WWW2NZZ_COOKIE_LIST ]]; then echo "WWW2NZZ_COOKIE_LIST 变量存在,并成功赋值" ;else WWW2NZZ_COOKIE_LIST=[]; fi;
|
||||
if [[ $SMZDM_COOKIE_LIST ]]; then echo "SMZDM_COOKIE_LIST 变量存在,并成功赋值" ;else SMZDM_COOKIE_LIST=[]; fi;
|
||||
|
||||
|
||||
JSONSTR="{
|
||||
@ -53,6 +54,7 @@ JSONSTR="{
|
||||
\"LIANTONG_ACCOUNT_LIST\": ${LIANTONG_ACCOUNT_LIST},
|
||||
\"V2EX_COOKIE_LIST\": ${V2EX_COOKIE_LIST},
|
||||
\"WWW2NZZ_COOKIE_LIST\": ${WWW2NZZ_COOKIE_LIST},
|
||||
\"SMZDM_COOKIE_LIST\": ${SMZDM_COOKIE_LIST},
|
||||
\"TIEBA_COOKIE_LIST\": ${TIEBA_COOKIE_LIST}
|
||||
}"
|
||||
echo $JSONSTR > config.json
|
||||
|
@ -140,5 +140,13 @@
|
||||
{
|
||||
"www2nzz_cookie": "帐号2 cookie"
|
||||
}
|
||||
],
|
||||
"SMZDM_COOKIE_LIST": [
|
||||
{
|
||||
"smzdm_cookie": "账号1 cookie"
|
||||
},
|
||||
{
|
||||
"smzdm_cookie": "账号2 cookie"
|
||||
}
|
||||
]
|
||||
}
|
@ -28,6 +28,7 @@
|
||||
|签到|联通营业厅|每日签到|每天一次|
|
||||
|签到|V2EX|每日签到|每天一次|
|
||||
|签到|咔叽网单|每日签到|每天一次|
|
||||
|签到|什么值得买|每日签到|每天一次|
|
||||
|羊毛|喜马拉雅极速版|金币获取|30分钟一次|
|
||||
|其他|百度站点|提交网站页面供百度收录|每天一次|
|
||||
|其他|每日天气预报|获取指定的多个城市天气信息|每天一次|
|
||||
|
@ -147,6 +147,14 @@
|
||||
{
|
||||
"www2nzz_cookie": "帐号2 cookie"
|
||||
}
|
||||
],
|
||||
"SMZDM_COOKIE_LIST": [
|
||||
{
|
||||
"smzdm_cookie": "账号1 cookie"
|
||||
},
|
||||
{
|
||||
"smzdm_cookie": "账号2 cookie"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
@ -195,6 +203,7 @@
|
||||
|_**LIANTONG_ACCOUNT_LIST**_.data|联通营业厅|非必须|联通营业厅 每日签到|
|
||||
|_**V2EX_COOKIE_LIST**_.v2ex_cookie|V2EX|非必须|[V2EX](https://www.v2ex.com/) 每日签到|
|
||||
|_**WWW2NZZ_COOKIE_LIST**_.www2nzz_cookie|咔叽网单|非必须|[咔叽网单](https://www.2nzz.com/) 每日签到|
|
||||
|_**SMZDM_COOKIE_LIST**_.smzdm_cookie|咔叽网单|非必须|[什么值得买](https://www.smzdm.com) 每日签到|
|
||||
|
||||
## 参数获取方法
|
||||
|
||||
@ -299,6 +308,10 @@
|
||||
|
||||
[咔叽网单](https://www.2nzz.com/)
|
||||
|
||||
#### 什么值得买 Cookie 参数获取
|
||||
|
||||
[什么值得买](https://www.smzdm.com)
|
||||
|
||||
### APP抓包
|
||||
|
||||
#### 喜马拉雅极速版 Cookie 参数获取
|
||||
|
7
index.py
7
index.py
@ -20,6 +20,7 @@ from liantong import LianTongCheckIn
|
||||
from motto import Motto
|
||||
from music163 import Music163CheckIn
|
||||
from oneplusbbs import OnePlusBBSCheckIn
|
||||
from smzdm import SmzdmCheckIn
|
||||
from tieba import TiebaCheckIn
|
||||
from v2ex import V2exCheckIn
|
||||
from vqq import VQQCheckIn
|
||||
@ -126,6 +127,7 @@ def main_handler(event, context):
|
||||
www2nzz_cookie_list = (
|
||||
json.loads(os.getenv("WWW2NZZ_COOKIE_LIST", [])) if os.getenv("WWW2NZZ_COOKIE_LIST") else []
|
||||
)
|
||||
smzdm_cookie_list = json.loads(os.getenv("SMZDM_COOKIE_LIST", [])) if os.getenv("SMZDM_COOKIE_LIST") else []
|
||||
|
||||
else:
|
||||
if isinstance(event, dict):
|
||||
@ -160,6 +162,7 @@ def main_handler(event, context):
|
||||
liantong_account_list = data.get("LIANTONG_ACCOUNT_LIST", [])
|
||||
v2ex_cookie_list = data.get("V2EX_COOKIE_LIST", [])
|
||||
www2nzz_cookie_list = data.get("WWW2NZZ_COOKIE_LIST", [])
|
||||
smzdm_cookie_list = data.get("SMZDM_COOKIE_LIST", [])
|
||||
|
||||
content_list = [f"当前时间: {utc_time}"]
|
||||
if message == "xmly":
|
||||
@ -222,6 +225,10 @@ def main_handler(event, context):
|
||||
msg_list = WWW2nzzCheckIn(www2nzz_cookie_list=www2nzz_cookie_list).main()
|
||||
content_list += msg_list
|
||||
|
||||
if smzdm_cookie_list:
|
||||
msg_list = SmzdmCheckIn(smzdm_cookie_list=smzdm_cookie_list).main()
|
||||
content_list += msg_list
|
||||
|
||||
if city_name_list:
|
||||
msg_list = Weather(city_name_list=city_name_list).main()
|
||||
content_list += msg_list
|
||||
|
@ -26,9 +26,3 @@ inputs:
|
||||
cronExpression: "0 */30 * * * * *"
|
||||
enable: true
|
||||
argument: xmly
|
||||
- timer: # 企鹅读书
|
||||
parameters:
|
||||
name: qqread
|
||||
cronExpression: "0 */11 * * * * *"
|
||||
enable: true
|
||||
argument: qqread
|
||||
|
2
smzdm/__init__.py
Normal file
2
smzdm/__init__.py
Normal file
@ -0,0 +1,2 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from smzdm.smzdm import SmzdmCheckIn
|
62
smzdm/smzdm.py
Normal file
62
smzdm/smzdm.py
Normal file
@ -0,0 +1,62 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import json
|
||||
import os
|
||||
|
||||
import requests
|
||||
|
||||
|
||||
class SmzdmCheckIn:
|
||||
def __init__(self, smzdm_cookie_list):
|
||||
self.smzdm_cookie_list = smzdm_cookie_list
|
||||
|
||||
@staticmethod
|
||||
def sign(session):
|
||||
current = session.get(url='https://zhiyou.smzdm.com/user/info/jsonp_get_current').json()
|
||||
if current['checkin']['has_checkin']:
|
||||
msg = f"用户信息: {current['nickname']}\n目前积分: {current['point']}\n" \
|
||||
f"经验值: {current['exp']}\n金币: {current['gold']}\n" \
|
||||
f"碎银子: {current['silver']}\n威望: {current['prestige']}\n等级: {current['level']}\n" \
|
||||
f"已经签到: {current['checkin']['daily_checkin_num']} 天"
|
||||
else:
|
||||
response = session.get(url="https://zhiyou.smzdm.com/user/checkin/jsonp_checkin").json()
|
||||
msg = f"用户信息: {current['nickname']}\n目前积分: {response['point']}\n" \
|
||||
f"增加积分: {response['add_point']}\n经验值: {response['exp']}\n" \
|
||||
f"金币: {response['gold']}\n威望: {response['prestige']}\n等级: {response['rank']}"
|
||||
|
||||
print(msg)
|
||||
return msg
|
||||
|
||||
def main(self):
|
||||
msg_list = []
|
||||
for smzdm_cookie in self.smzdm_cookie_list:
|
||||
smzdm_cookie = {
|
||||
item.split("=")[0]: item.split("=")[1] for item in smzdm_cookie.get("smzdm_cookie").split("; ")
|
||||
}
|
||||
session = requests.session()
|
||||
requests.utils.add_dict_to_cookiejar(session.cookies, smzdm_cookie)
|
||||
session.headers.update(
|
||||
{
|
||||
"Accept": "*/*",
|
||||
"Accept-Encoding": "gzip, deflate, br",
|
||||
"Accept-Language": "zh-CN,zh;q=0.9",
|
||||
"Connection": "keep-alive",
|
||||
"Host": "zhiyou.smzdm.com",
|
||||
"Referer": "https://www.smzdm.com/",
|
||||
"Sec-Fetch-Dest": "script",
|
||||
"Sec-Fetch-Mode": "no-cors",
|
||||
"Sec-Fetch-Site": "same-site",
|
||||
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.131 Safari/537.36",
|
||||
}
|
||||
)
|
||||
sign_msg = self.sign(session=session)
|
||||
msg = f"【什么值得买】\n{sign_msg}"
|
||||
print(msg)
|
||||
msg_list.append(msg)
|
||||
return msg_list
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
with open(os.path.join(os.path.dirname(os.path.dirname(__file__)), "config.json"), "r", encoding="utf-8") as f:
|
||||
datas = json.loads(f.read())
|
||||
_smzdm_cookie_list = datas.get("SMZDM_COOKIE_LIST", [])
|
||||
SmzdmCheckIn(smzdm_cookie_list=_smzdm_cookie_list).main()
|
Loading…
Reference in New Issue
Block a user