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
40692df0
Commit
40692df0
authored
Apr 19, 2019
by
lixiaofang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add
parent
6c25e328
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
7 additions
and
30 deletions
+7
-30
workspace.xml
.idea/workspace.xml
+0
-0
auto_click.py
auto_click.py
+0
-2
auto_request.py
auto_request.py
+1
-0
auto_user_id.py
auto_user_id.py
+0
-4
offline_comment.py
offline_comment.py
+6
-24
No files found.
.idea/workspace.xml
View file @
40692df0
This diff is collapsed.
Click to expand it.
auto_click.py
View file @
40692df0
import
requests
import
time
import
datetime
import
pymysql
import
random
import
traceback
...
...
auto_request.py
View file @
40692df0
...
...
@@ -30,6 +30,7 @@ DATABASES = {
}
}
host
=
DATABASES
[
'default'
][
'HOST'
]
user
=
DATABASES
[
'default'
][
'USER'
]
...
...
auto_user_id.py
View file @
40692df0
...
...
@@ -8,8 +8,6 @@ from log_settings import *
def
get_data
():
try
:
pc
=
pymysql
.
connect
(
host
=
host
,
user
=
user
,
passwd
=
passwd
,
db
=
db
,
port
=
3306
)
cursor
=
pc
.
cursor
()
cursor
.
execute
(
"select user_id from user_extra where is_shadow = 1 "
)
...
...
@@ -21,8 +19,6 @@ 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"
)
...
...
offline_comment.py
View file @
40692df0
import
requests
import
time
import
datetime
import
pymysql
import
random
import
pandas
as
pd
import
traceback
from
log_settings
import
*
import
traceback
import
logging
from
auto_request
import
get_offline_comment
from
auto_request
import
host
,
user
,
db
,
passwd
...
...
@@ -31,7 +28,6 @@ def get_user_id():
return
user_list
def
reply
(
id
,
content
,
user_id
):
try
:
post_dict
=
{
...
...
@@ -54,44 +50,30 @@ def get_data(num1, num2):
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 is_online =1 and (id > 0 and id <= 10000) and (content_level = 4 or content_level = 5) "
)
"SELECT id,user_id FROM topic WHERE is_online =1 and (id > "
+
str
(
num1
)
+
" and id <= "
+
str
(
num2
)
+
") and (content_level = 4 or content_level = 5) "
)
data
=
cursor
.
fetchall
()
topic_id
=
list
(
data
)
# logging.info("Database version : %s " % topic_id)
user_list
=
get_user_id
()
# logging.info("get user_list:%s"%user_list)
topic_id_list
=
[]
if
topic_id
:
for
i
in
topic_id
:
print
(
i
[
1
])
print
(
"========"
)
if
int
(
i
[
1
])
in
user_list
:
topic_id_list
.
append
(
i
)
print
(
i
)
print
(
"--------"
)
pc
.
close
()
print
(
topic_id_list
)
logging
.
info
(
"get topic_id_list:
%
s"
%
topic_id_list
)
return
topic_id_list
except
:
logging
.
error
(
"catch exception,get_data:
%
s"
%
traceback
.
format_exc
())
return
None
if
__name__
==
"__main__"
:
try
:
time_list
=
[[
0
,
10000
],
[
10000
,
20000
]]
# [10000, 20000],
# [20000, 30000],
# ["2017-03-30 15:57:49.000000", "2016-03-30 15:57:49.000000"],
# ["2018-03-30 15:57:49.000000", "2017-03-30 15:57:49.000000"],
# ["2019-03-30 15:57:49.000000", "2018-03-30 15:57:49.000000"]]
time_list
=
[[
0
,
100000
],
[
100000
,
200000
],
[
200000
,
300000
],
[
300000
,
400000
],
[
400000
,
500000
][
600000
,
700000
]]
user_data
=
open
(
"user_id.txt"
,
"r"
)
...
...
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