Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
P
physical
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
钟尚武
physical
Commits
853a9447
Commit
853a9447
authored
Aug 12, 2019
by
lixiaofang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add
parent
2d0e5c57
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
103 additions
and
2 deletions
+103
-2
trans2es_mapping2es.py
trans2es/management/commands/trans2es_mapping2es.py
+7
-2
one_seven_star_topic.py
vest/click/one_seven_star_topic.py
+49
-0
one_seven_topic_comment.py
vest/reply/one_seven_topic_comment.py
+47
-0
No files found.
trans2es/management/commands/trans2es_mapping2es.py
View file @
853a9447
...
...
@@ -7,8 +7,9 @@ import traceback
import
logging
from
libs.es
import
ESPerform
from
trans2es.type_info
import
get_type_info_map
,
TypeInfo
from
vest.reply
import
true_comment_one
,
true_comment_two
,
true_comment_three
from
vest.click
import
true_click_five
,
true_click_two
,
true_click_four
,
true_click_one
,
true_click_three
from
vest.reply
import
true_comment_one
,
true_comment_two
,
true_comment_three
,
one_seven_topic_comment
from
vest.click
import
true_click_five
,
true_click_two
,
true_click_four
,
true_click_one
,
true_click_three
,
\
one_seven_star_topic
from
vest.follow
import
auto_follow
,
auto_follow_new
from
vest.urge
import
auto_star_urge
,
auto_lunch_app
,
auto_lunch_app2
,
auto_urge1
,
auto_urge2
from
vest.fix
import
fix_no_comment_click
...
...
@@ -79,6 +80,8 @@ class Command(BaseCommand):
true_click_four
.
true_click_four
()
if
options
[
"mvest"
]
==
"true_click_five"
:
true_click_five
.
true_click_five
()
if
options
[
"mvest"
]
==
"one_seven_star_topic"
:
one_seven_star_topic
.
one_seven_star_topic
()
# 评论
if
options
[
"mvest"
]
==
"true_comment_one"
:
...
...
@@ -87,6 +90,8 @@ class Command(BaseCommand):
true_comment_two
.
true_comment_two
()
if
options
[
"mvest"
]
==
"true_comment_three"
:
true_comment_three
.
true_comment_three
()
if
options
[
"mvest"
]
==
"one_seven_topic_comment"
:
one_seven_topic_comment
.
one_seven_topic_comment
()
# 催更
if
options
[
"mvest"
]
==
"auto_urge1"
:
...
...
vest/click/one_seven_star_topic.py
0 → 100644
View file @
853a9447
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 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_list
except
:
logging
.
error
(
"catch exception,get_data:
%
s"
%
traceback
.
format_exc
())
def
one_seven_star_topic
():
try
:
numtime
,
numtime2
=
time_convs
(
1
,
7
)
user_id
=
get_data
(
numtime
,
numtime2
)
dicts
=
{}
logging
.
info
(
"get user_id:
%
s"
%
user_id
)
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
())
vest/reply/one_seven_topic_comment.py
0 → 100644
View file @
853a9447
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 distinct(user_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,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_list
except
:
logging
.
error
(
"catch exception,get_data:
%
s"
%
traceback
.
format_exc
())
def
one_seven_topic_comment
():
try
:
numtime
,
numtime2
=
time_convs
(
1
,
7
)
user_id
=
get_data
(
numtime
,
numtime2
)
logging
.
info
(
"get user_id:
%
s"
%
user_id
)
for
i
in
user_id
:
cook
=
login
()
if
cook
is
not
None
:
click
(
cook
,
i
[
1
])
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