-
Notifications
You must be signed in to change notification settings - Fork 46
/
Copy pathindex.php
66 lines (54 loc) · 1.21 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<?php
/**
* This is a test file.
*
* @author Ning Luo <[email protected]>
* @copyright This code is copyright to me.
* @license MIT
* @package lndj/Lcrawl
*/
require 'vendor/autoload.php';
use Lndj\Lcrawl;
//stu_id
$stu_id = '201404739';
//your password
$password = 'xxxxxx';
$user = ['stu_id' => $stu_id, 'stu_pwd' => $password];
$client = new Lcrawl('http://xuanke.lzjtu.edu.cn/', $user, false);
$client->login();
$all = $client->setUa('Lcrawl Spider V2.0.2')->getGrade();
//setTimeOut()
//setReferer
//set...
dd($all);
// dd($client->login());
// $client->getSchedule();
// $client->getCet();
//Set the login post param
/*
[
'viewstate' => '__VIEWSTATE',
'stu_id' => 'TextBox1',
'passwod' => 'TextBox2',
'role' => 'RadioButtonList1',
'button' => 'Button1'
]
*/
/**
* Just a debug function
* @param Obeject/Array/string $arr
* @param String $hint debug hint
* @return void
*/
function dd($arr,$hint = '')
{
if (is_object($arr) || is_array($arr)) {
echo "<pre>";
print_r($arr);
echo PHP_EOL . $hint;
echo "</pre>";
} else {
var_dump($arr);
echo PHP_EOL . $hint;
}
}