Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
cybertron
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
cybertron
Commits
53be1169
Commit
53be1169
authored
Apr 19, 2019
by
lixiaofang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add
parent
a840c8d8
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
3 deletions
+33
-3
workspace.xml
.idea/workspace.xml
+0
-0
instant.py
instant.py
+33
-3
No files found.
.idea/workspace.xml
View file @
53be1169
This diff is collapsed.
Click to expand it.
instant.py
View file @
53be1169
...
...
@@ -7,7 +7,7 @@ import pandas as pd
import
traceback
from
log_settings
import
*
import
logging
from
auto_request
import
get_offline_comment
,
login
,
click
from
auto_request
import
login
,
click
,
get_comments
,
reply
import
threading
from
auto_request
import
host
,
user
,
db
,
passwd
...
...
@@ -18,7 +18,8 @@ if __name__ == "__main__":
pc
=
pymysql
.
connect
(
host
=
host
,
user
=
user
,
passwd
=
passwd
,
db
=
db
,
port
=
3306
)
cursor
=
pc
.
cursor
()
cursor
.
execute
(
"SELECT id,user_id FROM topic WHERE id = "
+
str
(
927745
)
+
" and user_id in (select user_id from user_extra where is_shadow = 0)"
)
"SELECT id,user_id FROM topic WHERE id = "
+
str
(
id
)
+
" and user_id in (select user_id from user_extra where is_shadow = 0)"
)
data
=
cursor
.
fetchall
()
topic_id_list
=
list
(
data
)
logging
.
info
(
"Database version :
%
s "
%
topic_id_list
)
...
...
@@ -28,10 +29,35 @@ if __name__ == "__main__":
exec_count
=
0
if
topic_id_list
:
def
fun_comment
():
cookies
=
login
()
if
cookies
:
comment_content
=
get_comments
()
comment
=
comment_content
[
0
]
reply
(
cookies
,
id
,
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
()
def
fun_timer
():
cookies
=
login
()
if
cookies
:
click
(
cookies
,
topic_id_list
)
click
(
cookies
,
topic_id_list
[
0
])
global
timer
global
exec_count
...
...
@@ -49,7 +75,11 @@ if __name__ == "__main__":
timer
.
start
()
sleep_time
=
random
.
randint
(
300
,
540
)
timer
=
threading
.
Timer
(
10
,
fun_comment
)
# 首次启动
timer
.
start
()
sleep_time
=
random
.
randint
(
300
,
540
)
timer
=
threading
.
Timer
(
10
,
fun_timer
)
# 首次启动
timer
.
start
()
...
...
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