Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
P
physical
Project
Project
Details
Activity
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
alpha
physical
Commits
e08a81fd
Commit
e08a81fd
authored
Apr 24, 2019
by
lixiaofang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add
parent
76f007f0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
62 additions
and
58 deletions
+62
-58
tasks.py
injection/data_sync/tasks.py
+62
-58
No files found.
injection/data_sync/tasks.py
View file @
e08a81fd
...
...
@@ -121,35 +121,36 @@ def auto_click(pk_list):
pc
.
close
()
exec_count
=
0
if
topic_id_list
:
def
fun_timer
():
cookies
=
login
()
if
cookies
:
click
(
cookies
,
topic_id_list
[
0
])
global
timer
global
exec_count
exec_count
+=
1
if
exec_count
==
1
:
logging
.
info
(
"----------2-----------"
)
# sleep_time = random.randint(300, 540)
sleep_time
=
30
timer
=
threading
.
Timer
(
sleep_time
,
fun_timer
)
timer
.
start
()
if
exec_count
==
2
:
# sleep_time = random.randint(1000, 1900)
logging
.
info
(
"----------3-----------"
)
sleep_time
=
50
timer
=
threading
.
Timer
(
sleep_time
,
fun_timer
)
timer
.
start
()
sleep_time
=
random
.
randint
(
300
,
540
)
logging
.
info
(
"----------1-----------"
)
timer
=
threading
.
Timer
(
10
,
fun_timer
)
# 首次启动
timer
.
start
()
try
:
def
fun_timer
():
cookies
=
login
()
if
cookies
:
click
(
cookies
,
topic_id_list
[
0
])
global
timer
global
exec_count
exec_count
+=
1
if
exec_count
==
1
:
logging
.
info
(
"----------2-----------"
)
# sleep_time = random.randint(300, 540)
sleep_time
=
30
timer
=
threading
.
Timer
(
sleep_time
,
fun_timer
)
timer
.
start
()
if
exec_count
==
2
:
# sleep_time = random.randint(1000, 1900)
logging
.
info
(
"----------3-----------"
)
sleep_time
=
50
timer
=
threading
.
Timer
(
sleep_time
,
fun_timer
)
timer
.
start
()
sleep_time
=
random
.
randint
(
300
,
540
)
logging
.
info
(
"----------1-----------"
)
timer
=
threading
.
Timer
(
10
,
fun_timer
)
# 首次启动
timer
.
start
()
except
:
logging
.
error
(
"catch exception,main:
%
s"
%
traceback
.
format_exc
())
else
:
pass
except
:
...
...
@@ -167,41 +168,44 @@ def auto_reply(pk_list):
cursor
.
execute
(
"SELECT id,user_id FROM topic WHERE id in "
+
str
(
tuple
(
pk_list
))
+
" and user_id in (select user_id from user_extra where is_shadow = 0) and create_time > '
%
s'"
%
now
)
pk_list
))
+
" and user_id in (select user_id from user_extra where is_shadow = 0) and create_time > '
%
s'
"
%
now
)
data
=
cursor
.
fetchall
()
topic_id_list
=
list
(
data
)
logging
.
info
(
"Database version :
%
s "
%
topic_id_list
)
pc
.
close
()
exec_count
=
0
if
topic_id_list
:
def
fun_comment
():
cookies
=
login
()
if
cookies
:
comment_content
=
get_comments
()
comment
=
comment_content
[
0
]
reply
(
cookies
,
topic_id_list
[
0
],
comment
)
global
timer
global
exec_count
exec_count
+=
1
if
exec_count
==
1
:
sleep_time
=
random
.
randint
(
300
,
540
)
sleep_time
=
30
timer
=
threading
.
Timer
(
sleep_time
,
fun_comment
)
timer
.
start
()
if
exec_count
==
2
:
sleep_time
=
random
.
randint
(
1000
,
1900
)
sleep_time
=
30
timer
=
threading
.
Timer
(
sleep_time
,
fun_comment
)
timer
.
start
()
sleep_time
=
random
.
randint
(
300
,
540
)
timer
=
threading
.
Timer
(
10
,
fun_comment
)
# 首次启动
timer
.
start
()
try
:
def
fun_comment
():
cookies
=
login
()
if
cookies
:
comment_content
=
get_comments
()
comment
=
comment_content
[
0
]
reply
(
cookies
,
topic_id_list
[
0
],
comment
)
global
timer
global
exec_count
exec_count
+=
1
if
exec_count
==
1
:
sleep_time
=
random
.
randint
(
300
,
540
)
sleep_time
=
30
timer
=
threading
.
Timer
(
sleep_time
,
fun_comment
)
timer
.
start
()
if
exec_count
==
2
:
sleep_time
=
random
.
randint
(
1000
,
1900
)
sleep_time
=
30
timer
=
threading
.
Timer
(
sleep_time
,
fun_comment
)
timer
.
start
()
sleep_time
=
random
.
randint
(
300
,
540
)
timer
=
threading
.
Timer
(
10
,
fun_comment
)
# 首次启动
timer
.
start
()
except
:
logging
.
error
(
"catch exception,main:
%
s"
%
traceback
.
format_exc
())
except
:
logging
.
error
(
"catch exception,main:
%
s"
%
traceback
.
format_exc
())
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