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
b03ad5b5
Commit
b03ad5b5
authored
Apr 22, 2019
by
lixiaofang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add
parent
ba9eca6c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
11 deletions
+6
-11
auto_instant_click.py
majia/auto_instant_click.py
+6
-11
No files found.
majia/auto_instant_click.py
View file @
b03ad5b5
...
@@ -13,19 +13,17 @@ from get_session import get_comments, get_cookies, click, time_conv, login, repl
...
@@ -13,19 +13,17 @@ from get_session import get_comments, get_cookies, click, time_conv, login, repl
@shared_task
@shared_task
def
auto_click
(
id
):
def
auto_click
(
pk_list
):
try
:
try
:
pc
=
pymysql
.
connect
(
host
=
host
,
user
=
user
,
passwd
=
passwd
,
db
=
db
,
port
=
3306
)
pc
=
pymysql
.
connect
(
host
=
host
,
user
=
user
,
passwd
=
passwd
,
db
=
db
,
port
=
3306
)
cursor
=
pc
.
cursor
()
cursor
=
pc
.
cursor
()
cursor
.
execute
(
cursor
.
execute
(
"SELECT id,user_id FROM topic WHERE id
= "
+
str
(
"SELECT id,user_id FROM topic WHERE id
in "
+
(
id
)
+
" and user_id in (select user_id from user_extra where is_shadow = 0)"
)
pk_list
)
+
" and user_id in (select user_id from user_extra where is_shadow = 0)"
)
data
=
cursor
.
fetchall
()
data
=
cursor
.
fetchall
()
topic_id_list
=
list
(
data
)
topic_id_list
=
list
(
data
)
logging
.
info
(
"Database version :
%
s "
%
topic_id_list
)
logging
.
info
(
"Database version :
%
s "
%
topic_id_list
)
pc
.
close
()
pc
.
close
()
topic_id_list
=
919337
exec_count
=
0
exec_count
=
0
if
topic_id_list
:
if
topic_id_list
:
...
@@ -50,8 +48,6 @@ def auto_click(id):
...
@@ -50,8 +48,6 @@ def auto_click(id):
timer
=
threading
.
Timer
(
sleep_time
,
fun_timer
)
timer
=
threading
.
Timer
(
sleep_time
,
fun_timer
)
timer
.
start
()
timer
.
start
()
sleep_time
=
random
.
randint
(
300
,
540
)
sleep_time
=
random
.
randint
(
300
,
540
)
timer
=
threading
.
Timer
(
10
,
fun_comment
)
# 首次启动
timer
=
threading
.
Timer
(
10
,
fun_comment
)
# 首次启动
timer
.
start
()
timer
.
start
()
...
@@ -67,13 +63,13 @@ def auto_click(id):
...
@@ -67,13 +63,13 @@ def auto_click(id):
@shared_task
@shared_task
def
auto_reply
(
id
):
def
auto_reply
(
pk_list
):
try
:
try
:
pc
=
pymysql
.
connect
(
host
=
host
,
user
=
user
,
passwd
=
passwd
,
db
=
db
,
port
=
3306
)
pc
=
pymysql
.
connect
(
host
=
host
,
user
=
user
,
passwd
=
passwd
,
db
=
db
,
port
=
3306
)
cursor
=
pc
.
cursor
()
cursor
=
pc
.
cursor
()
cursor
.
execute
(
cursor
.
execute
(
"SELECT id,user_id FROM topic WHERE id
= "
+
str
(
"SELECT id,user_id FROM topic WHERE id
in "
+
(
id
)
+
" and user_id in (select user_id from user_extra where is_shadow = 0)"
)
pk_list
)
+
" and user_id in (select user_id from user_extra where is_shadow = 0)"
)
data
=
cursor
.
fetchall
()
data
=
cursor
.
fetchall
()
topic_id_list
=
list
(
data
)
topic_id_list
=
list
(
data
)
logging
.
info
(
"Database version :
%
s "
%
topic_id_list
)
logging
.
info
(
"Database version :
%
s "
%
topic_id_list
)
...
@@ -113,4 +109,3 @@ def auto_reply(id):
...
@@ -113,4 +109,3 @@ def auto_reply(id):
except
:
except
:
logging
.
error
(
"catch exception,main:
%
s"
%
traceback
.
format_exc
())
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