youlan 2021-10-25 14:28:57
掘金签到脚本
import requests,json
from apscheduler.schedulers.blocking import BlockingScheduler
from datetime import datetime
url = 'https://api.juejin.cn/growth_api/v1/check_in'
# 签到的接口能看到这些信息
data = {
'aid':'你的aid',
'uuid':'你的uuid',
'_signature': '你的_signature'}
header = {
"cookie": '你的cookie'
}
# 请求签到接口
def SignIn():
r =requests.post(url,data, headers = header)
print(r.text)
# 输出
def job():
print(datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
SignIn()
if __name__ == "__main__":
# 每天早上六点半签到
scheduler = BlockingScheduler()
scheduler.add_job(job, 'cron', day_of_week='0-6', hour=6, minute=30)
scheduler.start()