本站自动签到脚本简化版 [ 技术分享 ]
// 引入querylist组件,方式composer require jaeger/querylist
$home_url = "https://www.yiichina.com";
$ql = QueryList::getInstance();
$ql->get("{$home_url}/login");
$csrf = $ql->find("input[name='_csrf']")->val();
$username = \Yii::$app->params['yiichina-username'];
$password = \Yii::$app->params['yiichina-password'];;
$userInfo= [
'_csrf' => $csrf,
'LoginForm[username]' => $username,
'LoginForm[password]' => $password,
'LoginForm[rememberMe]' => '1',
];
$ql->post("{$home_url}/login", $userInfo);
$ql->get("{$home_url}");
$csrf = $ql->find("input[name='_csrf']")->val();
$ql->post("{$home_url}/registration", [
'_csrf' => $csrf,
], [
'headers' => [
'accept' => "application/json, text/javascript, */*; q=0.01",
'accept-encoding' => "gzip, deflate, br",
'accept-language' => "en,zh-CN;q=0.9,zh;q=0.8,zh-TW;q=0.7",
'content-type' => "application/x-www-form-urlencoded; charset=UTF-8",
'origin' => "{$home_url}",
'referer' => "{$home_url}",
'user-agent' => "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.86 Safari/537.36",
'x-csrf-token' => $csrf,
'x-requested-with' => "XMLHttpRequest",
],
]);
共 0 条回复
没有找到数据。
wodrow China
注册时间:2015-04-09
最后登录:15小时前
在线时长:199小时13分
最后登录:15小时前
在线时长:199小时13分
- 粉丝34
- 金钱42675
- 威望120
- 积分45865