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
8744fcfb
Commit
8744fcfb
authored
Apr 23, 2019
by
lixiaofang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add
parent
dcb2458f
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
23 deletions
+26
-23
workspace.xml
.idea/workspace.xml
+0
-0
auto_commnet.py
auto_commnet.py
+0
-5
auto_every_day.py
auto_every_day.py
+12
-14
testss.py
testss.py
+14
-4
No files found.
.idea/workspace.xml
View file @
8744fcfb
This diff is collapsed.
Click to expand it.
auto_commnet.py
View file @
8744fcfb
...
...
@@ -21,7 +21,6 @@ def get_topic_id(numtime1, numtime2):
)
data
=
cursor
.
fetchall
()
topic_id
=
list
(
data
)
logging
.
info
(
"Database version :
%
s "
%
topic_id
)
topic_id_list
=
[]
if
topic_id
:
for
i
in
topic_id
:
...
...
@@ -63,8 +62,6 @@ if __name__ == "__main__":
else
:
dicts
[
i
[
1
]]
.
append
(
i
[
0
])
logging
.
info
(
"get dicts:
%
s"
%
dicts
)
for
key
,
value
in
dicts
.
items
():
rand_num
=
random
.
randint
(
0
,
len
(
value
)
-
1
)
...
...
@@ -73,8 +70,6 @@ if __name__ == "__main__":
comment
=
get_comment
()
logging
.
info
(
"get comment:
%
s"
%
comment
)
for
i
in
range
(
1
):
time
.
sleep
(
random
.
randint
(
10
,
20
))
...
...
auto_every_day.py
View file @
8744fcfb
...
...
@@ -10,22 +10,22 @@ from auto_request import login, time_convs, follow, get_user_id
from
auto_request
import
host
,
user
,
port
,
db
,
passwd
def
get_topic_new_user
(
numtime
):
def
get_topic_new_user
(
numtime
1
,
numtime2
):
try
:
pc
=
pymysql
.
connect
(
host
=
host
,
user
=
user
,
passwd
=
passwd
,
db
=
db
,
port
=
port
)
cursor
=
pc
.
cursor
()
cursor
.
execute
(
"SELECT distinct(user_id) FROM topic WHERE is_online=1 and create_time
LIKE '
%%%%%
s
%%%%
' "
%
numtime
)
"SELECT distinct(user_id) FROM topic WHERE is_online=1 and create_time
> '
%
s' "
%
numtime1
)
topic_data
=
cursor
.
fetchall
()
cursor
.
execute
(
"SELECT distinct(user_id) FROM group_user_role WHERE create_time
LIKE '
%%%%%
s
%%%%
'"
%
numtime
)
"SELECT distinct(user_id) FROM group_user_role WHERE create_time
> '
%
s'"
%
numtime1
)
new_user_data
=
cursor
.
fetchall
()
topic_data
=
list
(
topic_data
)
new_user_data
=
list
(
new_user_data
)
topic_id_list
=
[]
if
topic_data
:
if
topic_data
:
for
i
in
topic_data
:
cursor
.
execute
(
"select user_id from user_extra where user_id ="
+
str
(
i
[
0
])
+
" and is_shadow =0"
)
...
...
@@ -54,26 +54,24 @@ def get_topic_new_user(numtime):
if
__name__
==
"__main__"
:
try
:
numtime
=
time_convs
(
0
)
numtime
1
,
numtime2
=
time_convs
(
1
,
1
)
user_id
=
get_topic_new_user
(
numtime
)
user_id
=
get_topic_new_user
(
numtime
1
)
follow_num
=
random
.
randint
(
1
,
2
)
for
i
in
range
(
follow_num
):
if
user_id
:
for
j
in
user_id
and
user_id
:
for
j
in
user_id
:
id
=
int
(
j
[
0
])
id
=
int
(
j
[
0
]
)
time
.
sleep
(
random
.
randint
(
10
,
30
)
)
time
.
sleep
(
random
.
randint
(
10
,
30
)
)
cookies
=
login
(
)
cookies
=
login
()
if
cookies
is
not
None
:
follow
(
cookies
,
id
)
if
cookies
is
not
None
:
follow
(
cookies
,
id
)
except
:
logging
.
error
(
"catch exception,main:
%
s"
%
traceback
.
format_exc
())
testss.py
View file @
8744fcfb
...
...
@@ -14,6 +14,16 @@
#
# print(yes_time_str)
# print(yes_time_str2)
import
random
rand_num
=
random
.
randint
(
0
,
2
)
print
(
rand_num
)
\ No newline at end of file
# import random
# rand_num = random.randint(0,2)
# print(rand_n
#
# um)
import
datetime
now
=
datetime
.
datetime
.
now
()
yes_time
=
now
-
datetime
.
timedelta
(
days
=
1
)
yes_time_str
=
yes_time
.
strftime
(
'
%
Y-
%
m-
%
d'
)
yes_time_str
=
yes_time_str
+
' 23:59:59.000000'
print
(
yes_time_str
)
\ No newline at end of file
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