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
c1ef7414
Commit
c1ef7414
authored
Apr 25, 2019
by
lixiaofang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add
parent
9615b761
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
128 additions
and
15 deletions
+128
-15
workspace.xml
.idea/workspace.xml
+0
-0
auto_click1.py
auto_click1.py
+26
-15
auto_click2.py
auto_click2.py
+52
-0
auto_click3.py
auto_click3.py
+50
-0
No files found.
.idea/workspace.xml
View file @
c1ef7414
This diff is collapsed.
Click to expand it.
auto_click.py
→
auto_click
1
.py
View file @
c1ef7414
...
@@ -4,20 +4,20 @@ import random
...
@@ -4,20 +4,20 @@ import random
import
traceback
import
traceback
from
log_settings
import
*
from
log_settings
import
*
import
logging
import
logging
from
auto_request
import
login
,
click
,
time_conv
s
from
auto_request
import
login
,
click
,
time_conv
from
auto_request
import
host
,
user
,
db
,
passwd
from
auto_request
import
host
,
user
,
db
,
passwd
def
get_data
(
numtime
,
numtime2
):
def
get_data
(
numtime
):
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 user_id,id FROM topic WHERE is_online=1 and create_time > '
%
s' and create_time <= '
%
s'"
%
(
"SELECT user_id,id FROM topic WHERE is_online=1 and create_time > '
%
s'"
%
numtime
)
numtime
,
numtime2
))
data
=
cursor
.
fetchall
()
data
=
cursor
.
fetchall
()
topic_id
=
list
(
data
)
topic_id
=
list
(
data
)
topic_id_list
=
[]
topic_id_list
=
[]
try
:
for
i
in
topic_id
and
topic_id
:
for
i
in
topic_id
and
topic_id
:
cursor
.
execute
(
cursor
.
execute
(
"select user_id from user_extra where user_id ="
+
str
(
i
[
0
])
+
" and is_shadow =0"
)
"select user_id from user_extra where user_id ="
+
str
(
i
[
0
])
+
" and is_shadow =0"
)
...
@@ -27,6 +27,10 @@ def get_data(numtime, numtime2):
...
@@ -27,6 +27,10 @@ def get_data(numtime, numtime2):
topic_id_list
.
append
(
i
)
topic_id_list
.
append
(
i
)
logging
.
info
(
"Database version :
%
s "
%
topic_id_list
)
logging
.
info
(
"Database version :
%
s "
%
topic_id_list
)
pc
.
close
()
pc
.
close
()
except
:
pass
return
topic_id_list
return
topic_id_list
except
:
except
:
...
@@ -34,25 +38,31 @@ def get_data(numtime, numtime2):
...
@@ -34,25 +38,31 @@ def get_data(numtime, numtime2):
return
[]
return
[]
def
write_id_file
(
id
):
try
:
data
=
open
(
"save_topic_id.txt"
,
"a"
)
data
.
write
(
id
)
data
.
write
(
"/n"
)
except
:
pass
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
try
:
try
:
time_list
=
[
3
,
4
,
5
,
6
,
7
]
numtime
=
time_conv
(
10
)
user_id
=
get_data
(
numtime
)
for
i
in
time_list
:
numtime
,
numtime2
=
time_convs
(
i
+
1
,
i
-
1
)
user_id
=
get_data
(
numtime
,
numtime2
)
dicts
=
{}
dicts
=
{}
if
user_id
:
if
user_id
:
for
i
in
user_id
:
for
i
in
user_id
:
if
i
[
0
]
not
in
dicts
.
keys
():
if
i
[
0
]
not
in
dicts
.
keys
():
dicts
.
setdefault
(
i
[
0
],
[])
dicts
.
setdefault
(
i
[
0
],
[])
dicts
[
i
[
0
]]
.
append
(
i
[
1
])
dicts
[
i
[
0
]]
.
append
(
i
[
1
])
else
:
else
:
dicts
[
i
[
0
]]
.
append
(
i
[
1
])
dicts
[
i
[
0
]]
.
append
(
i
[
1
])
...
@@ -62,16 +72,17 @@ if __name__ == "__main__":
...
@@ -62,16 +72,17 @@ if __name__ == "__main__":
rand_id
=
value
[
rand_num
]
rand_id
=
value
[
rand_num
]
urge_num
=
random
.
randint
(
0
,
1
)
for
i
in
range
(
urge_num
):
time
.
sleep
(
random
.
randint
(
1
,
10
))
time
.
sleep
(
random
.
randint
(
1
,
10
))
cook
=
login
()
cook
=
login
()
if
cook
is
not
None
:
if
cook
is
not
None
:
click
(
cook
,
rand_id
)
click
(
cook
,
rand_id
)
write_id_file
(
rand_id
)
else
:
else
:
pass
pass
...
...
auto_click2.py
0 → 100644
View file @
c1ef7414
import
time
import
pymysql
import
random
import
traceback
from
log_settings
import
*
import
logging
from
auto_request
import
login
,
click
,
time_conv
def
write_id_file
():
try
:
user_ids
=
[]
data
=
open
(
"save_topic_id.txt"
,
"r"
)
data2
=
open
(
"save_topic_id_three.txt"
,
"w"
)
for
i
in
data
.
readlines
():
data2
.
write
(
i
)
data2
.
write
(
"
\n
"
)
user_ids
.
append
(
i
)
data
.
truncate
()
return
user_ids
except
:
return
[]
if
__name__
==
"__main__"
:
try
:
user_ids
=
write_id_file
()
lenn
=
len
(
user_ids
)
random
=
[]
for
i
in
range
(
lenn
/
2
):
rand_num
=
random
.
randint
(
0
,
lenn
)
random
.
append
(
lenn
[
rand_num
])
for
i
in
random
:
time
.
sleep
(
random
.
randint
(
10
,
50
))
cook
=
login
()
if
cook
is
not
None
:
click
(
cook
,
i
)
except
:
logging
.
error
(
"catch exception,main:
%
s"
%
traceback
.
format_exc
())
auto_click3.py
0 → 100644
View file @
c1ef7414
import
time
import
pymysql
import
random
import
traceback
from
log_settings
import
*
import
logging
from
auto_request
import
login
,
click
,
time_conv
def
write_id_file
():
try
:
user_ids
=
[]
data
=
open
(
"save_topic_id_three.txt"
,
"r"
)
for
i
in
data
.
readlines
():
user_ids
.
append
(
i
)
data
.
truncate
()
return
user_ids
except
:
return
[]
if
__name__
==
"__main__"
:
try
:
user_ids
=
write_id_file
()
lenn
=
len
(
user_ids
)
random
=
[]
for
i
in
range
(
lenn
/
2
):
rand_num
=
random
.
randint
(
0
,
lenn
)
random
.
append
(
lenn
[
rand_num
])
for
i
in
random
:
time
.
sleep
(
random
.
randint
(
10
,
30
))
cook
=
login
()
if
cook
is
not
None
:
click
(
cook
,
i
)
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