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
a4575de5
Commit
a4575de5
authored
Aug 12, 2019
by
lixiaofang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add
parent
e18906c9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
7 deletions
+23
-7
workspace.xml
.idea/workspace.xml
+0
-0
auto_click_51.py
auto_click_51.py
+20
-7
auto_request.py
auto_request.py
+3
-0
No files found.
.idea/workspace.xml
View file @
a4575de5
This diff is collapsed.
Click to expand it.
auto_click_51.py
View file @
a4575de5
...
...
@@ -4,7 +4,7 @@ import random
import
traceback
from
log_settings
import
*
import
logging
from
auto_request
import
login
,
click
,
time_conv
from
auto_request
import
login
,
click
,
time_conv
s
from
auto_request
import
host
,
user
,
db
,
passwd
...
...
@@ -13,24 +13,37 @@ def get_data(numtime, numtime2):
pc
=
pymysql
.
connect
(
host
=
host
,
user
=
user
,
passwd
=
passwd
,
db
=
db
,
port
=
3306
)
cursor
=
pc
.
cursor
()
cursor
.
execute
(
"select id from topic where content_level in (4,5,6) and create_time > '2019-05-01 00:00:00.0000' and id not in (select topic_id from reply )"
)
"SELECT distinct(user_id) FROM topic WHERE is_online=1 and content_level in (4,5,6) and (create_time >= '
%
s' and create_time <= '
%
s')"
%
(
numtime
,
numtime2
))
data
=
cursor
.
fetchall
()
topic_id
=
list
(
data
)
topic_id_list
=
[]
for
i
in
topic_id
and
topic_id
:
cursor
.
execute
(
"select user_id,is_shadow from user_extra where user_id ="
+
str
(
i
[
0
])
+
" and is_online =1 and is_deleted =0"
)
data
=
cursor
.
fetchall
()
user_id
=
list
(
data
)
if
(
user_id
and
user_id
[
0
][
1
]
==
0
)
or
len
(
user_id
)
==
0
:
topic_id_list
.
append
(
i
)
logging
.
info
(
"Database version :
%
s "
%
topic_id_list
)
pc
.
close
()
return
topic_id
return
topic_id
_list
except
:
logging
.
error
(
"catch exception,get_data:
%
s"
%
traceback
.
format_exc
())
if
__name__
==
"__main__"
:
try
:
numtime
,
numtime2
=
time_conv
(
15
,
5
)
numtime
,
numtime2
=
time_conv
s
(
1
,
7
)
user_id
=
get_data
(
numtime
,
numtime2
)
dicts
=
{}
logging
.
info
(
"get user_id:
%
s"
%
user_id
)
for
i
in
user_id
:
cook
=
login
()
if
cook
is
not
None
:
click
(
cook
,
i
)
rand_num
=
random
.
randint
(
0
,
1
)
if
rand_num
==
1
:
cook
=
login
()
if
cook
is
not
None
:
click
(
cook
,
i
[
1
])
except
:
logging
.
error
(
"catch exception,main:
%
s"
%
traceback
.
format_exc
())
auto_request.py
View file @
a4575de5
...
...
@@ -207,6 +207,9 @@ def time_convs(numtime, numtime2):
yes_time_str2
=
yes_time2
.
strftime
(
'
%
Y-
%
m-
%
d'
)
yes_time_str2
=
yes_time_str2
+
' 00:00:00.000000'
logging
.
info
(
"get yes_time_str:
%
s"
%
yes_time_str
)
logging
.
info
(
"get yes_time_str2:
%
s"
%
yes_time_str2
)
return
yes_time_str
,
yes_time_str2
except
:
return
None
...
...
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