Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
EduSpider
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
viitto
EduSpider
Commits
7acb0792
Commit
7acb0792
authored
May 25, 2022
by
黄奎
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.oytour.com/viitto/eduspider
parents
9809c35b
af48136b
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
90 additions
and
11 deletions
+90
-11
IStudentRepository.cs
EduSpider.IRepository/IStudentRepository.cs
+22
-0
StudentRepository.cs
EduSpider.Repository/StudentRepository.cs
+11
-2
JObjectHelper.cs
EduSpider.Utility/JObjectHelper.cs
+28
-0
EduSpider.sln
EduSpider.sln
+2
-2
ClassInAccountManager.cs
EduSpider/Spiders/ClassInRule/ClassInAccountManager.cs
+1
-1
StudentManager.cs
EduSpider/Spiders/ClassInRule/StudentManager.cs
+26
-6
No files found.
EduSpider.IRepository/IStudentRepository.cs
0 → 100644
View file @
7acb0792
using
EduSpider.Model.Entity
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
using
VTX.FW.Config
;
using
VTX.FW.DB
;
namespace
EduSpider.IRepository
{
public
interface
IStudentRepository
:
IDBRepository
<
RB_Student
>,
IDependency
{
/// <summary>
/// 批量操作学生资料
/// </summary>
/// <param name="students"></param>
/// <returns></returns>
public
bool
BatchSetStudent
(
List
<
RB_Student
>
students
);
}
}
EduSpider.Repository/StudentRepository.cs
View file @
7acb0792
using
System
;
using
EduSpider.IRepository
;
using
EduSpider.Model.Entity
;
using
EduSpider.Repository.Base
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
...
...
@@ -6,7 +9,13 @@ using System.Threading.Tasks;
namespace
EduSpider.Repository
{
public
class
StudentRepository
public
class
StudentRepository
:
BaseRepository
<
RB_Student
>,
IStudentRepository
{
public
bool
BatchSetStudent
(
List
<
RB_Student
>
students
)
{
bool
flag
;
flag
=
base
.
BatchInsert
(
students
,
isReplace
:
true
);
return
flag
;
}
}
}
EduSpider.Utility/JObjectHelper.cs
0 → 100644
View file @
7acb0792
using
Newtonsoft.Json.Linq
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
EduSpider.Utility
{
public
static
class
JObjectHelper
{
public
static
bool
TryFromString
(
this
JObject
obj
,
string
str
)
{
var
flag
=
true
;
try
{
obj
=
JObject
.
Parse
(
str
);
}
catch
(
Exception
)
{
flag
=
false
;
obj
=
new
JObject
();
}
return
flag
;
}
}
}
EduSpider.sln
View file @
7acb0792
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 1
6
VisualStudioVersion = 1
6.0.31729.503
# Visual Studio Version 1
7
VisualStudioVersion = 1
7.1.32210.238
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EduSpider.Model", "EduSpider.Model\EduSpider.Model.csproj", "{58B2199B-FE72-4F48-972D-F7FE32A28A0F}"
EndProject
...
...
EduSpider/Spiders/ClassInRule/ClassInAccountManager.cs
View file @
7acb0792
...
...
@@ -24,7 +24,7 @@ namespace TicketSpider.Spiders.ClassInRule
private
static
object
lockerSafe
=
new
object
();
private
static
string
_loginCookies
=
"locationArgumentLang=zh-CN; sensorsdata2015jssdkcross={\"distinct_id\":\"12780052\",\"first_id\":\"180e074a47f92f-06489d0bb8915b-6b3e555b-1327104-180e074a4805d2\",\"props\":{\"$latest_traffic_source_type\":\"直接流量\",\"$latest_search_keyword\":\"未取到值_直接打开\",\"$latest_referrer\":\"\"},\"$device_id\":\"180e074a47f92f-06489d0bb8915b-6b3e555b-1327104-180e074a4805d2\"}; _eeos_uid=12780052; _eeos_useraccount=18140082327; _eeos_userlogo=/upload/images/20200126/709df9532bee722f2268_70.jpg; _eeos_domain=.eeo.cn; _eeos_sid=12780052; _eeos_nsid=kspGu2gfMu+U2EFgLpSGyg==; __tk_id=5792ca4f7a6655c40c4431fbdb729da4; PHPSESSID=l5aanmebp5lvpcbg630ccfha37; _eeos_traffic=EqlIOFq4S2hz5FTTtHzNUViBYcWCixrJYMCF6Y5yJuD8eq8ZwPvVSHMvUkLFA5lzNoaTrDBpGhEY7ykZ9lwMAsNJoNiDt2xKQBr9csRmiBE="
;
private
static
string
_loginCookies
=
null
;
//
"locationArgumentLang=zh-CN; sensorsdata2015jssdkcross={\"distinct_id\":\"12780052\",\"first_id\":\"180e074a47f92f-06489d0bb8915b-6b3e555b-1327104-180e074a4805d2\",\"props\":{\"$latest_traffic_source_type\":\"直接流量\",\"$latest_search_keyword\":\"未取到值_直接打开\",\"$latest_referrer\":\"\"},\"$device_id\":\"180e074a47f92f-06489d0bb8915b-6b3e555b-1327104-180e074a4805d2\"}; _eeos_uid=12780052; _eeos_useraccount=18140082327; _eeos_userlogo=/upload/images/20200126/709df9532bee722f2268_70.jpg; _eeos_domain=.eeo.cn; _eeos_sid=12780052; _eeos_nsid=kspGu2gfMu+U2EFgLpSGyg==; __tk_id=5792ca4f7a6655c40c4431fbdb729da4; PHPSESSID=l5aanmebp5lvpcbg630ccfha37; _eeos_traffic=EqlIOFq4S2hz5FTTtHzNUViBYcWCixrJYMCF6Y5yJuD8eq8ZwPvVSHMvUkLFA5lzNoaTrDBpGhEY7ykZ9lwMAsNJoNiDt2xKQBr9csRmiBE=";
private
static
bool
_openHeartTimer
=
false
;
...
...
EduSpider/Spiders/ClassInRule/StudentManager.cs
View file @
7acb0792
using
EduSpider.Model.Entity
;
using
EduSpider.Repository
;
using
EduSpider.Utility.Enum
;
using
EduSpider.Utility
;
using
Newtonsoft.Json
;
using
Newtonsoft.Json.Linq
;
using
System
;
using
System.Collections.Generic
;
...
...
@@ -15,15 +16,34 @@ namespace EduSpider.Spiders.ClassInRule
public
async
void
RunAsync
(
string
cookie
)
{
var
request
=
Utility
.
HttpHelper
.
GenerateHttp
(
cookie
);
var
paramStr
=
"page=1&perpage=20&isdel=0"
;
var
content
=
new
StringContent
(
paramStr
,
System
.
Text
.
Encoding
.
UTF8
,
"application/x-www-form-urlencoded"
);
var
response
=
await
request
.
PostAsync
(
"https://console.eeo.cn/saasajax/student.ajax.php?action=getSchoolStudentListByPage"
,
content
);
int
pageIndex
=
1
,
pageCount
=
1
,
pageSize
=
10000
;
var
result
=
response
.
Content
.
ReadAsStringAsync
().
Result
;
}
while
(
pageIndex
<=
pageCount
)
{
var
paramStr
=
$"page=
{
pageIndex
}
&perpage=
{
pageSize
}
&isdel=0"
;
var
content
=
new
StringContent
(
paramStr
,
System
.
Text
.
Encoding
.
UTF8
,
"application/x-www-form-urlencoded"
);
var
response
=
await
request
.
PostAsync
(
"https://console.eeo.cn/saasajax/student.ajax.php?action=getSchoolStudentListByPage"
,
content
);
var
resultStr
=
response
.
Content
.
ReadAsStringAsync
().
Result
??
string
.
Empty
;
var
result
=
new
JObject
();
if
(
result
.
TryFromString
(
resultStr
))
{
var
data
=
(
result
.
ContainsKey
(
"data"
)
?
result
[
"data"
]
:
new
JObject
())
as
JObject
;
if
(
data
.
ContainsKey
(
"totalStudentNum"
))
{
#
region
更新
PageCount
if
(
pageIndex
==
1
)
{
pageCount
=
(
int
)
Math
.
Ceiling
(
data
.
GetDecimal
(
"totalStudentNum"
)
/
pageSize
);
}
#
endregion
var
students
=
JsonConvert
.
DeserializeObject
<
RB_Student
>(
data
.
GetString
(
"studentList"
));
}
}
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment