Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
L
lcc-akm
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
wangmingming
lcc-akm
Commits
43d9cecc
Commit
43d9cecc
authored
Mar 21, 2023
by
王明明
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vy nk
parent
808176f7
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
1 deletion
+25
-1
akm_init.go
src/model/akm_init.go
+23
-0
vueling.go
src/model/vueling.go
+1
-1
run.sh
src/run.sh
+1
-0
No files found.
src/model/akm_init.go
View file @
43d9cecc
...
...
@@ -128,6 +128,29 @@ func (akm *AkmClient) GetAllCookie() map[string]string {
}
return
res
}
func
(
akm
*
AkmClient
)
postSensorJs
(
times
int
)
error
{
abck
,
bm_sz
:=
akm
.
GetCookie
()
t1
:=
time
.
Now
()
datas
:=
fmt
.
Sprintf
(
"times=%d&abck=%s&bm_sz=%s&url=%s"
,
times
,
abck
,
bm_sz
,
akm
.
postUrl
)
r
,
_
:=
http
.
Post
(
"http://127.0.0.1:3033/akm2t"
,
"application/x-www-form-urlencoded"
,
strings
.
NewReader
(
datas
))
rs
,
_
:=
io
.
ReadAll
(
r
.
Body
)
rsss
:=
strings
.
Split
(
string
(
rs
),
"|||||"
)
sensorData
:=
rsss
[
0
]
UA
:=
rsss
[
1
]
akm
.
ua
=
UA
t2
:=
time
.
Now
()
sensor_data
:=
"{
\"
sensor_data
\"
:
\"
"
+
sensorData
+
"
\"
}"
akm
.
logger
.
Info
(
"sensor"
,
sensor_data
)
statusCode
,
err
:=
akm
.
PostJson
(
times
,
akm
.
SensorUrl
,
sensor_data
)
if
err
!=
nil
{
return
err
}
abck
,
bm_sz
=
akm
.
GetCookie
()
akm
.
logger
.
Info
(
"第"
,
times
,
"生成一次 abck 耗时 "
,
t2
.
Sub
(
t1
)
.
String
(),
" 响应abck结果 "
,
statusCode
,
" abck长度 "
,
len
(
abck
),
" 请求耗时 "
,
time
.
Since
(
t2
)
.
String
())
return
nil
}
func
(
akm
*
AkmClient
)
postSensor
(
times
int
)
error
{
abck
,
bmsz
:=
akm
.
GetCookie
()
...
...
src/model/vueling.go
View file @
43d9cecc
...
...
@@ -12,7 +12,7 @@ func VueLing(carrierType, proxyUrl string) (*Akm, error) {
return
nil
,
err
}
for
i
:=
0
;
i
<
4
;
i
++
{
err
:=
akmClient
.
postSensor
(
i
)
err
:=
akmClient
.
postSensor
Js
(
i
)
if
err
!=
nil
{
akmClient
.
logger
.
WithError
(
err
)
.
Errorln
(
"请求失败"
)
return
nil
,
err
...
...
src/run.sh
View file @
43d9cecc
export
GOPROXY
=
https://goproxy.cn
cd
/root/src/js
&&
npm i
&&
nohup
node run.js
>
1.log 2>&1 &
cd
/root/src
&&
go run main.go
\ No newline at end of file
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