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
5e4d6a92
Commit
5e4d6a92
authored
May 07, 2019
by
lixiaofang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add
parent
b8d46e05
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
373 additions
and
293 deletions
+373
-293
encodings.xml
.idea/encodings.xml
+2
-1
workspace.xml
.idea/workspace.xml
+0
-0
auto_click.py
auto_click.py
+79
-0
auto_click1.py
auto_click1.py
+4
-39
auto_click2.py
auto_click2.py
+37
-49
auto_click3.py
auto_click3.py
+37
-44
auto_click4.py
auto_click4.py
+56
-0
auto_click5.py
auto_click5.py
+56
-0
auto_click_instant.py
auto_click_instant.py
+0
-3
auto_comment.py
auto_comment.py
+0
-0
auto_comment1.py
auto_comment1.py
+9
-40
auto_comment2.py
auto_comment2.py
+41
-46
auto_comment3.py
auto_comment3.py
+40
-46
auto_lunch_app.py
auto_lunch_app.py
+2
-1
auto_star_topic.py
auto_star_topic.py
+2
-2
auto_star_urge.py
auto_star_urge.py
+0
-1
auto_urge.py
auto_urge.py
+0
-1
auto_urge_three.py
auto_urge_three.py
+2
-2
auto_user_id.py
auto_user_id.py
+3
-12
offline_comment.py
offline_comment.py
+3
-6
No files found.
.idea/encodings.xml
View file @
5e4d6a92
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"Encoding"
>
<file
url=
"file://$PROJECT_DIR$/auto_comm
ne
t.py"
charset=
"GBK"
/>
<file
url=
"file://$PROJECT_DIR$/auto_comm
en
t.py"
charset=
"GBK"
/>
<file
url=
"file://$PROJECT_DIR$/comment.txt"
charset=
"UTF-8"
/>
</component>
</project>
\ No newline at end of file
.idea/workspace.xml
View file @
5e4d6a92
This diff is collapsed.
Click to expand it.
auto_click.py
0 → 100644
View file @
5e4d6a92
import
time
import
pymysql
import
random
import
traceback
from
log_settings
import
*
import
logging
from
auto_request
import
login
,
click
,
time_convs
from
auto_request
import
host
,
user
,
db
,
passwd
def
get_data
(
numtime
,
numtime2
):
try
:
pc
=
pymysql
.
connect
(
host
=
host
,
user
=
user
,
passwd
=
passwd
,
db
=
db
,
port
=
3306
)
cursor
=
pc
.
cursor
()
cursor
.
execute
(
"SELECT user_id,id FROM topic WHERE is_online=1 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 from user_extra where user_id ="
+
str
(
i
[
0
])
+
" and is_shadow =0"
)
data
=
cursor
.
fetchall
()
user_id
=
list
(
data
)
if
user_id
:
topic_id_list
.
append
(
i
)
logging
.
info
(
"Database version :
%
s "
%
topic_id_list
)
pc
.
close
()
return
topic_id_list
except
:
logging
.
error
(
"catch exception,get_data:
%
s"
%
traceback
.
format_exc
())
return
[]
if
__name__
==
"__main__"
:
try
:
time_list
=
[
1
,
2
,
3
,
4
,
5
,
6
,
7
]
for
i
in
time_list
:
numtime
,
numtime2
=
time_convs
(
i
+
1
,
i
-
1
)
user_id
=
get_data
(
numtime
,
numtime2
)
dicts
=
{}
if
user_id
:
for
i
in
user_id
:
if
i
[
0
]
not
in
dicts
.
keys
():
dicts
.
setdefault
(
i
[
0
],
[])
dicts
[
i
[
0
]]
.
append
(
i
[
1
])
else
:
dicts
[
i
[
0
]]
.
append
(
i
[
1
])
for
key
,
value
in
dicts
.
items
():
rand_num
=
random
.
randint
(
0
,
len
(
value
)
-
1
)
rand_id
=
value
[
rand_num
]
urge_num
=
random
.
randint
(
0
,
1
)
for
i
in
range
(
urge_num
):
time
.
sleep
(
random
.
randint
(
1
,
10
))
cook
=
login
()
if
cook
is
not
None
:
click
(
cook
,
rand_id
)
else
:
pass
except
:
logging
.
error
(
"catch exception,main:
%
s"
%
traceback
.
format_exc
())
\ No newline at end of file
auto_click1.py
View file @
5e4d6a92
...
...
@@ -15,9 +15,8 @@ def get_data(numtime, numtime2):
logging
.
info
(
"get numtime:
%
s"
%
numtime
)
logging
.
info
(
"get numtime2:
%
s"
%
numtime2
)
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' and create_time <=
'
%
s')"
%
(
numtime
,
numtime2
))
data
=
cursor
.
fetchall
()
topic_id
=
list
(
data
)
topic_id_list
=
[]
...
...
@@ -32,56 +31,22 @@ def get_data(numtime, numtime2):
topic_id_list
.
append
(
i
)
logging
.
info
(
"Database version :
%
s "
%
topic_id_list
)
pc
.
close
()
except
:
pass
return
topic_id_list
except
:
logging
.
error
(
"catch exception,get_data:
%
s"
%
traceback
.
format_exc
())
return
[]
def
write_id_file
(
id
):
try
:
data
=
open
(
"save_topic_id.txt"
,
"a"
)
data
.
write
(
str
(
id
))
data
.
write
(
"
\n
"
)
except
:
logging
.
error
(
"catch exception,main:
%
s"
%
traceback
.
format_exc
())
if
__name__
==
"__main__"
:
try
:
data1
=
open
(
"save_topic_id.txt"
,
"w"
)
data1
.
truncate
()
numtime
,
numtime2
=
time_conv
(
5
,
0
)
numtime
,
numtime2
=
time_conv
(
15
,
5
)
user_id
=
get_data
(
numtime
,
numtime2
)
dicts
=
{}
for
i
in
user_id
and
user_id
:
if
i
[
0
]
not
in
dicts
.
keys
():
dicts
.
setdefault
(
i
[
0
],
[])
dicts
[
i
[
0
]]
.
append
(
i
[
1
])
else
:
dicts
[
i
[
0
]]
.
append
(
i
[
1
])
for
key
,
value
in
dicts
.
items
():
rand_num
=
random
.
randint
(
0
,
len
(
value
)
-
1
)
rand_id
=
value
[
rand_num
]
time
.
sleep
(
random
.
randint
(
1
,
10
))
for
i
in
user_id
:
cook
=
login
()
if
cook
is
not
None
:
write_id_file
(
rand_id
)
click
(
cook
,
rand_id
)
click
(
cook
,
i
[
1
])
except
:
logging
.
error
(
"catch exception,main:
%
s"
%
traceback
.
format_exc
())
auto_click2.py
View file @
5e4d6a92
...
...
@@ -4,63 +4,51 @@ import random
import
traceback
from
log_settings
import
*
import
logging
from
auto_request
import
login
,
click
from
auto_request
import
login
,
click
,
time_conv
from
auto_request
import
host
,
user
,
db
,
passwd
def
write_id_file
(
):
def
get_data
(
numtime
,
numtime2
):
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
(
str
(
i
.
strip
()))
data2
.
write
(
"
\n
"
)
user_ids
.
append
(
int
(
i
))
return
user_ids
pc
=
pymysql
.
connect
(
host
=
host
,
user
=
user
,
passwd
=
passwd
,
db
=
db
,
port
=
3306
)
cursor
=
pc
.
cursor
()
logging
.
info
(
"get numtime:
%
s"
%
numtime
)
logging
.
info
(
"get numtime2:
%
s"
%
numtime2
)
cursor
.
execute
(
"SELECT user_id,id FROM topic WHERE is_online=1 and (create_time >= '
%
s' and create_time <= '
%
s')"
%
(
numtime
,
numtime2
))
data
=
cursor
.
fetchall
()
topic_id
=
list
(
data
)
topic_id_list
=
[]
logging
.
info
(
"get topic_id:
%
s"
%
topic_id
)
try
:
for
i
in
topic_id
and
topic_id
:
cursor
.
execute
(
"select user_id from user_extra where user_id ="
+
str
(
i
[
0
])
+
" and is_shadow =0"
)
data
=
cursor
.
fetchall
()
user_id
=
list
(
data
)
if
user_id
:
topic_id_list
.
append
(
i
)
logging
.
info
(
"Database version :
%
s "
%
topic_id_list
)
pc
.
close
()
except
:
pass
return
topic_id_list
except
:
logging
.
error
(
"catch exception,main:
%
s"
%
traceback
.
format_exc
())
logging
.
error
(
"catch exception,get_data:
%
s"
%
traceback
.
format_exc
())
return
[]
if
__name__
==
"__main__"
:
try
:
user_ids
=
write_id_file
()
lenn
=
len
(
user_ids
)
randoms_id
=
[]
if
lenn
==
1
:
time
.
sleep
(
random
.
randint
(
10
,
50
))
cook
=
login
()
if
cook
is
not
None
:
click
(
cook
,
user_ids
[
0
])
else
:
for
i
in
range
(
int
(
lenn
/
2
))
and
lenn
>
0
:
rand_num
=
random
.
randint
(
0
,
len
(
user_ids
)
-
1
)
randoms_id
.
append
(
user_ids
[
rand_num
])
if
randoms_id
:
for
i
in
randoms_id
:
time
.
sleep
(
random
.
randint
(
10
,
50
))
cook
=
login
()
if
cook
is
not
None
:
click
(
cook
,
i
)
numtime
,
numtime2
=
time_conv
(
27
,
17
)
user_id
=
get_data
(
numtime
,
numtime2
)
dicts
=
{}
for
i
in
user_id
:
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_click3.py
View file @
5e4d6a92
...
...
@@ -5,58 +5,51 @@ import traceback
from
log_settings
import
*
import
logging
from
auto_request
import
login
,
click
,
time_conv
from
auto_request
import
host
,
user
,
db
,
passwd
def
write_id_file
(
):
def
get_data
(
numtime
,
numtime2
):
try
:
user_ids
=
[]
data
=
open
(
"save_topic_id_three.txt"
,
"r"
)
for
i
in
data
.
readlines
():
user_ids
.
append
(
int
(
i
.
strip
()))
data
=
open
(
"save_topic_id_three.txt"
,
"w"
)
data
.
truncate
()
return
user_ids
pc
=
pymysql
.
connect
(
host
=
host
,
user
=
user
,
passwd
=
passwd
,
db
=
db
,
port
=
3306
)
cursor
=
pc
.
cursor
()
logging
.
info
(
"get numtime:
%
s"
%
numtime
)
logging
.
info
(
"get numtime2:
%
s"
%
numtime2
)
cursor
.
execute
(
"SELECT user_id,id FROM topic WHERE is_online=1 and (create_time >= '
%
s' and create_time <= '
%
s')"
%
(
numtime
,
numtime2
))
data
=
cursor
.
fetchall
()
topic_id
=
list
(
data
)
topic_id_list
=
[]
logging
.
info
(
"get topic_id:
%
s"
%
topic_id
)
try
:
for
i
in
topic_id
and
topic_id
:
cursor
.
execute
(
"select user_id from user_extra where user_id ="
+
str
(
i
[
0
])
+
" and is_shadow =0"
)
data
=
cursor
.
fetchall
()
user_id
=
list
(
data
)
if
user_id
:
topic_id_list
.
append
(
i
)
logging
.
info
(
"Database version :
%
s "
%
topic_id_list
)
pc
.
close
()
except
:
pass
return
topic_id_list
except
:
logging
.
error
(
"catch exception,
main
:
%
s"
%
traceback
.
format_exc
())
logging
.
error
(
"catch exception,
get_data
:
%
s"
%
traceback
.
format_exc
())
return
[]
if
__name__
==
"__main__"
:
try
:
user_ids
=
write_id_file
()
lenn
=
len
(
user_ids
)
randoms_id
=
[]
if
lenn
==
1
:
time
.
sleep
(
random
.
randint
(
10
,
50
))
cook
=
login
()
if
cook
is
not
None
:
click
(
cook
,
user_ids
[
0
])
else
:
for
i
in
range
(
int
(
lenn
/
2
)):
rand_num
=
random
.
randint
(
0
,
len
(
user_ids
)
-
1
)
randoms_id
.
append
(
user_ids
[
rand_num
])
if
randoms_id
:
for
i
in
randoms_id
:
time
.
sleep
(
random
.
randint
(
10
,
50
))
cook
=
login
()
if
cook
is
not
None
:
click
(
cook
,
i
)
logging
.
info
(
"click three"
)
numtime
,
numtime2
=
time_conv
(
45
,
35
)
user_id
=
get_data
(
numtime
,
numtime2
)
dicts
=
{}
for
i
in
user_id
:
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_click4.py
0 → 100644
View file @
5e4d6a92
import
time
import
pymysql
import
random
import
traceback
from
log_settings
import
*
import
logging
from
auto_request
import
login
,
click
,
time_conv
from
auto_request
import
host
,
user
,
db
,
passwd
def
get_data
(
numtime
,
numtime2
):
try
:
pc
=
pymysql
.
connect
(
host
=
host
,
user
=
user
,
passwd
=
passwd
,
db
=
db
,
port
=
3306
)
cursor
=
pc
.
cursor
()
logging
.
info
(
"get numtime:
%
s"
%
numtime
)
logging
.
info
(
"get numtime2:
%
s"
%
numtime2
)
cursor
.
execute
(
"SELECT user_id,id FROM topic WHERE is_online=1 and (create_time >= '
%
s' and create_time <= '
%
s')"
%
(
numtime
,
numtime2
))
data
=
cursor
.
fetchall
()
topic_id
=
list
(
data
)
topic_id_list
=
[]
logging
.
info
(
"get topic_id:
%
s"
%
topic_id
)
try
:
for
i
in
topic_id
and
topic_id
:
cursor
.
execute
(
"select user_id from user_extra where user_id ="
+
str
(
i
[
0
])
+
" and is_shadow =0"
)
data
=
cursor
.
fetchall
()
user_id
=
list
(
data
)
if
user_id
:
topic_id_list
.
append
(
i
)
logging
.
info
(
"Database version :
%
s "
%
topic_id_list
)
pc
.
close
()
except
:
pass
return
topic_id_list
except
:
logging
.
error
(
"catch exception,get_data:
%
s"
%
traceback
.
format_exc
())
return
[]
if
__name__
==
"__main__"
:
try
:
logging
.
info
(
"click four"
)
numtime
,
numtime2
=
time_conv
(
47
,
37
)
user_id
=
get_data
(
numtime
,
numtime2
)
dicts
=
{}
for
i
in
user_id
:
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
())
\ No newline at end of file
auto_click5.py
0 → 100644
View file @
5e4d6a92
import
time
import
pymysql
import
random
import
traceback
from
log_settings
import
*
import
logging
from
auto_request
import
login
,
click
,
time_conv
from
auto_request
import
host
,
user
,
db
,
passwd
def
get_data
(
numtime
,
numtime2
):
try
:
pc
=
pymysql
.
connect
(
host
=
host
,
user
=
user
,
passwd
=
passwd
,
db
=
db
,
port
=
3306
)
cursor
=
pc
.
cursor
()
logging
.
info
(
"get numtime:
%
s"
%
numtime
)
logging
.
info
(
"get numtime2:
%
s"
%
numtime2
)
cursor
.
execute
(
"SELECT user_id,id FROM topic WHERE is_online=1 and (create_time >= '
%
s' and create_time <= '
%
s')"
%
(
numtime
,
numtime2
))
data
=
cursor
.
fetchall
()
topic_id
=
list
(
data
)
topic_id_list
=
[]
logging
.
info
(
"get topic_id:
%
s"
%
topic_id
)
try
:
for
i
in
topic_id
and
topic_id
:
cursor
.
execute
(
"select user_id from user_extra where user_id ="
+
str
(
i
[
0
])
+
" and is_shadow =0"
)
data
=
cursor
.
fetchall
()
user_id
=
list
(
data
)
if
user_id
:
topic_id_list
.
append
(
i
)
logging
.
info
(
"Database version :
%
s "
%
topic_id_list
)
pc
.
close
()
except
:
pass
return
topic_id_list
except
:
logging
.
error
(
"catch exception,get_data:
%
s"
%
traceback
.
format_exc
())
return
[]
if
__name__
==
"__main__"
:
try
:
logging
.
info
(
"click five"
)
numtime
,
numtime2
=
time_conv
(
51
,
41
)
user_id
=
get_data
(
numtime
,
numtime2
)
dicts
=
{}
for
i
in
user_id
:
rand_num
=
random
.
randint
(
0
,
1
)
if
rand_num
==
1
:
cook
=
login
()
if
cook
is
not
None
:
# write_id_file(i[1])
click
(
cook
,
i
[
1
])
except
:
logging
.
error
(
"catch exception,main:
%
s"
%
traceback
.
format_exc
())
auto_click_instant.py
View file @
5e4d6a92
...
...
@@ -66,8 +66,5 @@ if __name__ == "__main__":
if
cook
is
not
None
:
click
(
cook
,
rand_id
)
except
:
logging
.
error
(
"catch exception,main:
%
s"
%
traceback
.
format_exc
())
auto_comm
ne
t.py
→
auto_comm
en
t.py
View file @
5e4d6a92
File moved
auto_comment1.py
View file @
5e4d6a92
import
time
import
pymysql
import
random
import
traceback
...
...
@@ -41,50 +40,20 @@ def get_data(numtime, numtime2):
return
[]
def
write_id_file
(
id
):
try
:
data
=
open
(
"save_topic_comment_id.txt"
,
"a"
)
data
.
write
(
str
(
id
))
data
.
write
(
"
\n
"
)
except
:
logging
.
error
(
"catch exception,main:
%
s"
%
traceback
.
format_exc
())
if
__name__
==
"__main__"
:
try
:
data1
=
open
(
"save_topic_comment_id.txt"
,
"w"
)
data1
.
truncate
()
numtime1
,
numtime2
=
time_conv
(
5
,
0
)
logging
.
info
(
"comment one"
)
numtime1
,
numtime2
=
time_conv
(
15
,
5
)
user_id
=
get_data
(
numtime1
,
numtime2
)
dicts
=
{}
for
i
in
user_id
and
user_id
:
if
i
[
0
]
not
in
dicts
.
keys
():
dicts
.
setdefault
(
i
[
0
],
[])
dicts
[
i
[
0
]]
.
append
(
i
[
1
])
if
user_id
:
for
i
in
user_id
:
cook
=
login
()
comment
=
get_comment
()
if
cook
is
not
None
:
reply
(
cook
,
i
[
1
],
comment
)
else
:
dicts
[
i
[
0
]]
.
append
(
i
[
1
])
for
key
,
value
in
dicts
.
items
():
rand_num
=
random
.
randint
(
0
,
len
(
value
)
-
1
)
rand_id
=
value
[
rand_num
]
time
.
sleep
(
random
.
randint
(
1
,
10
))
cook
=
login
()
comment
=
get_comment
()
if
cook
is
not
None
:
write_id_file
(
rand_id
)
reply
(
cook
,
rand_id
,
comment
)
else
:
logging
.
error
(
"catch exception,main:
%
s"
%
traceback
.
format_exc
())
logging
.
error
(
"catch exception,main:
%
s"
%
traceback
.
format_exc
())
except
:
logging
.
error
(
"catch exception,main:
%
s"
%
traceback
.
format_exc
())
auto_comment2.py
View file @
5e4d6a92
...
...
@@ -4,64 +4,59 @@ import random
import
traceback
from
log_settings
import
*
import
logging
from
auto_request
import
login
,
reply
,
get_comment
from
auto_request
import
login
,
time_conv
,
get_comment
,
reply
from
auto_request
import
host
,
user
,
db
,
passwd
def
write_id_file
(
):
def
get_data
(
numtime
,
numtime2
):
try
:
print
(
"...."
)
pc
=
pymysql
.
connect
(
host
=
host
,
user
=
user
,
passwd
=
passwd
,
db
=
db
,
port
=
3306
)
cursor
=
pc
.
cursor
()
cursor
.
execute
(
"SELECT user_id,id FROM topic WHERE is_online=1 and (create_time > '
%
s' and create_time < '
%
s' )"
%
(
numtime
,
numtime2
))
data
=
cursor
.
fetchall
()
topic_id
=
list
(
data
)
topic_id_list
=
[]
try
:
for
i
in
topic_id
and
topic_id
:
cursor
.
execute
(
"select user_id from user_extra where user_id ="
+
str
(
i
[
0
])
+
" and is_shadow =0"
)
data
=
cursor
.
fetchall
()
user_id
=
list
(
data
)
print
(
user_id
)
if
user_id
:
topic_id_list
.
append
(
i
)
logging
.
info
(
"Database version :
%
s "
%
topic_id_list
)
pc
.
close
()
except
:
logging
.
error
(
"catch exception,get_data:
%
s"
%
traceback
.
format_exc
())
return
topic_id_list
user_ids
=
[]
data
=
open
(
"save_topic_comment_id.txt"
,
"r"
)
data2
=
open
(
"save_topic_id_comment_three.txt"
,
"w"
)
for
i
in
data
.
readlines
():
data2
.
write
(
str
(
i
.
strip
()))
data2
.
write
(
"
\n
"
)
user_ids
.
append
(
int
(
i
))
return
user_ids
except
:
logging
.
error
(
"catch exception,main:
%
s"
%
traceback
.
format_exc
())
logging
.
error
(
"catch exception,get_data:
%
s"
%
traceback
.
format_exc
())
return
[]
if
__name__
==
"__main__"
:
try
:
user_ids
=
write_id_file
()
lenn
=
len
(
user_ids
)
randoms_id
=
[]
if
lenn
==
1
:
time
.
sleep
(
random
.
randint
(
10
,
50
))
comment
=
get_comment
()
cook
=
login
()
if
cook
is
not
None
:
reply
(
cook
,
user_ids
[
0
],
comment
)
else
:
for
i
in
range
(
int
(
lenn
/
2
)):
rand_num
=
random
.
randint
(
0
,
len
(
user_ids
)
-
1
)
randoms_id
.
append
(
user_ids
[
rand_num
])
if
randoms_id
:
for
i
in
randoms_id
:
time
.
sleep
(
random
.
randint
(
10
,
50
))
comment
=
get_comment
()
logging
.
info
(
"comment two"
)
numtime1
,
numtime2
=
time_conv
(
27
,
17
)
user_id
=
get_data
(
numtime1
,
numtime2
)
dicts
=
{}
if
user_id
:
for
i
in
user_id
:
rand_num
=
random
.
randint
(
0
,
1
)
if
rand_num
==
1
:
cook
=
login
()
comment
=
get_comment
()
if
cook
is
not
None
:
reply
(
cook
,
i
,
comment
)
reply
(
cook
,
i
[
1
],
comment
)
else
:
logging
.
error
(
"catch exception,main:
%
s"
%
traceback
.
format_exc
())
except
:
logging
.
error
(
"catch exception,main:
%
s"
%
traceback
.
format_exc
())
auto_comment3.py
View file @
5e4d6a92
...
...
@@ -4,65 +4,59 @@ import random
import
traceback
from
log_settings
import
*
import
logging
from
auto_request
import
login
,
get_comment
,
reply
from
auto_request
import
login
,
time_conv
,
get_comment
,
reply
from
auto_request
import
host
,
user
,
db
,
passwd
def
write_id_file
(
):
def
get_data
(
numtime
,
numtime2
):
try
:
print
(
"...."
)
pc
=
pymysql
.
connect
(
host
=
host
,
user
=
user
,
passwd
=
passwd
,
db
=
db
,
port
=
3306
)
cursor
=
pc
.
cursor
()
cursor
.
execute
(
"SELECT user_id,id FROM topic WHERE is_online=1 and (create_time > '
%
s' and create_time < '
%
s' )"
%
(
numtime
,
numtime2
))
data
=
cursor
.
fetchall
()
topic_id
=
list
(
data
)
topic_id_list
=
[]
try
:
for
i
in
topic_id
and
topic_id
:
cursor
.
execute
(
"select user_id from user_extra where user_id ="
+
str
(
i
[
0
])
+
" and is_shadow =0"
)
data
=
cursor
.
fetchall
()
user_id
=
list
(
data
)
print
(
user_id
)
if
user_id
:
topic_id_list
.
append
(
i
)
logging
.
info
(
"Database version :
%
s "
%
topic_id_list
)
pc
.
close
()
except
:
logging
.
error
(
"catch exception,get_data:
%
s"
%
traceback
.
format_exc
())
return
topic_id_list
user_ids
=
[]
data
=
open
(
"save_topic_id_comment_three.txt"
,
"r"
)
for
i
in
data
.
readlines
():
user_ids
.
append
(
int
(
i
.
strip
()))
data
=
open
(
"save_topic_id_comment_three.txt"
,
"w"
)
data
.
truncate
()
return
user_ids
except
:
logging
.
error
(
"catch exception,
main
:
%
s"
%
traceback
.
format_exc
())
logging
.
error
(
"catch exception,
get_data
:
%
s"
%
traceback
.
format_exc
())
return
[]
if
__name__
==
"__main__"
:
try
:
user_ids
=
write_id_file
()
lenn
=
len
(
user_ids
)
randoms_id
=
[]
if
lenn
==
1
:
time
.
sleep
(
random
.
randint
(
10
,
50
))
cook
=
login
()
comment
=
get_comment
()
cook
=
login
()
if
cook
is
not
None
:
reply
(
cook
,
user_ids
[
0
],
comment
)
else
:
for
i
in
range
(
int
(
lenn
/
2
)):
rand_num
=
random
.
randint
(
0
,
len
(
user_ids
)
-
1
)
randoms_id
.
append
(
user_ids
[
rand_num
])
if
randoms_id
:
for
i
in
randoms_id
:
time
.
sleep
(
random
.
randint
(
10
,
50
))
logging
.
info
(
" commend three"
)
numtime1
,
numtime2
=
time_conv
(
45
,
35
)
user_id
=
get_data
(
numtime1
,
numtime2
)
dicts
=
{}
if
user_id
:
for
i
in
user_id
:
rand_num
=
random
.
randint
(
0
,
1
)
if
rand_num
==
1
:
cook
=
login
()
comment
=
get_comment
()
cook
=
login
()
if
cook
is
not
None
:
reply
(
cook
,
i
,
comment
)
reply
(
cook
,
i
[
1
],
comment
)
else
:
logging
.
error
(
"catch exception,main:
%
s"
%
traceback
.
format_exc
())
except
:
logging
.
error
(
"catch exception,main:
%
s"
%
traceback
.
format_exc
())
auto_lunch_app.py
View file @
5e4d6a92
...
...
@@ -53,4 +53,4 @@ if __name__ == "__main__":
pass
except
:
logging
.
error
(
"catch exception,main:
%
s"
%
traceback
.
format_exc
())
logging
.
error
(
"catch exception,main:
%
s"
%
traceback
.
format_exc
())
\ No newline at end of file
auto_star_topic.py
View file @
5e4d6a92
...
...
@@ -16,7 +16,7 @@ def get_star_user_id(numtime1, numtime2):
cursor
=
pc
.
cursor
()
cursor
.
execute
(
"SELECT user_id,id FROM topic WHERE is_online=1 and (content_level =4 or content_level =5) and create_time > '
%
s' and create_time < '
%
s' "
%
(
numtime1
,
numtime2
))
numtime1
,
numtime2
))
data
=
cursor
.
fetchall
()
user_id_list
=
list
(
data
)
logging
.
info
(
"Database version :
%
s "
%
user_id_list
)
...
...
@@ -46,7 +46,7 @@ if __name__ == "__main__":
numtime1
,
numtime2
=
time_convs
(
i
+
1
,
i
-
1
)
user_topic_id
=
get_star_user_id
(
numtime1
,
numtime2
)
user_topic_id
=
get_star_user_id
(
numtime1
,
numtime2
)
try
:
...
...
auto_star_urge.py
View file @
5e4d6a92
...
...
@@ -35,7 +35,6 @@ def get_star_useid(numtime1, numtime2):
logging
.
error
(
"catch exception,get_data:
%
s"
%
traceback
.
format_exc
())
return
None
if
__name__
==
"__main__"
:
try
:
...
...
auto_urge.py
View file @
5e4d6a92
...
...
@@ -36,7 +36,6 @@ def get_data(numtime1,numtime2):
logging
.
error
(
"catch exception,get_data:
%
s"
%
traceback
.
format_exc
())
return
None
if
__name__
==
"__main__"
:
try
:
...
...
auto_urge_three.py
View file @
5e4d6a92
...
...
@@ -37,7 +37,6 @@ def get_data(numtime):
logging
.
error
(
"catch exception,get_data:
%
s"
%
traceback
.
format_exc
())
return
None
if
__name__
==
"__main__"
:
try
:
...
...
@@ -64,4 +63,4 @@ if __name__ == "__main__":
pass
except
:
logging
.
error
(
"catch exception,main:
%
s"
%
traceback
.
format_exc
())
logging
.
error
(
"catch exception,main:
%
s"
%
traceback
.
format_exc
())
\ No newline at end of file
auto_user_id.py
View file @
5e4d6a92
import
pymysql
import
traceback
import
logging
...
...
@@ -19,20 +18,12 @@ def get_data():
except
:
logging
.
error
(
"catch exception,get_data:
%
s"
%
traceback
.
format_exc
())
return
None
data
=
get_data
()
file
=
open
(
"user_id.txt"
,
"w"
)
file
=
open
(
"user_id.txt"
,
"w"
)
for
i
in
data
:
file
.
write
(
i
[
0
])
file
.
write
(
"
\n
"
)
offline_comment.py
View file @
5e4d6a92
...
...
@@ -7,7 +7,7 @@ import logging
from
auto_request
import
get_offline_comment
from
auto_request
import
host
,
user
,
db
,
passwd
auto_reply_url
=
"http://
47.93.162.11:8085
/api/v1/reply/create_for_inner"
auto_reply_url
=
"http://
saturn.iyanzhi.com
/api/v1/reply/create_for_inner"
def
reply
(
id
,
content
,
user_id
):
...
...
@@ -56,10 +56,8 @@ if __name__ == "__main__":
try
:
time_list
=
[[
0
,
10000
],
[
10000
,
20000
],
[
20000
,
30000
],
[
30000
,
40000
],
[
40000
,
50000
],
[
50000
,
60000
],
[
60000
,
70000
],
[
70000
,
80000
],
[
80000
,
90000
],
[
90000
,
100000
]]
# time_list = [[5479344,5479354]]
time_list
=
[[
24373571
,
34000000
],
[
34000001
,
45974231
]]
user_data
=
open
(
"/srv/apps/cybertron/user_id.txt"
,
"r"
)
...
...
@@ -87,7 +85,6 @@ if __name__ == "__main__":
comment_list
=
get_offline_comment
()
comment
=
comment_list
[
i
]
reply
(
id
[
0
],
comment
,
user_id
)
...
...
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