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
2373a7ad
Commit
2373a7ad
authored
Oct 23, 2019
by
吴升宇
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'wsy3' into 'master'
fix majia auto follow sql See merge request
alpha/physical!564
parents
ab172f78
58141833
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
18 deletions
+17
-18
auto_click_per_1d_by_post.py
vest/click/auto_click_per_1d_by_post.py
+2
-3
auto_click_per_2h_by_post.py
vest/click/auto_click_per_2h_by_post.py
+2
-3
auto_follow_per_1d_by_post.py
vest/follow/auto_follow_per_1d_by_post.py
+2
-3
auto_follow_per_1d_by_regist.py
vest/follow/auto_follow_per_1d_by_regist.py
+6
-4
auto_follow_per_2h_by_post_and_regist.py
vest/follow/auto_follow_per_2h_by_post_and_regist.py
+5
-5
No files found.
vest/click/auto_click_per_1d_by_post.py
View file @
2373a7ad
...
...
@@ -17,9 +17,8 @@ def get_commnet_id(numtime, numtime2, content_level_low=0, content_level_top=6):
cursor
.
execute
(
"select t.id from topic t left join user_extra u on t.user_id = u.user_id "
"where u.is_shadow=0 and t.create_time > '
%
s' and t.create_time < '
%
s' and t.is_online=1 "
"and t.content_level >=
%
s and t.content_level <=
%
s "
%
(
numtime
,
numtime2
,
str
(
content_level_low
),
str
(
content_level_top
)))
"select id from topic where is_shadow!= 1 and create_time > '
%
s' and create_time < '
%
s' and is_online=1 "
"and content_level >=
%
s and content_level <=
%
s "
%
(
numtime
,
numtime2
,
str
(
content_level_low
),
str
(
content_level_top
)))
res
=
cursor
.
fetchall
()
...
...
vest/click/auto_click_per_2h_by_post.py
View file @
2373a7ad
...
...
@@ -18,9 +18,8 @@ def get_commnet_id(numtime, numtime2, content_level_low=0, content_level_top=6):
# 发贴后
cursor
.
execute
(
"select t.id from topic t left join user_extra u on t.user_id = u.user_id "
"where u.is_shadow=0 and t.create_time > '
%
s' and t.create_time < '
%
s' and t.is_online=1 "
"and t.content_level >=
%
s and t.content_level <=
%
s "
%
(
numtime
,
numtime2
,
str
(
content_level_low
),
str
(
content_level_top
)))
"select id from topic where is_shadow!= 1 and create_time > '
%
s' and create_time < '
%
s' and is_online=1 "
"and content_level >=
%
s and content_level <=
%
s "
%
(
numtime
,
numtime2
,
str
(
content_level_low
),
str
(
content_level_top
)))
res
=
cursor
.
fetchall
()
...
...
vest/follow/auto_follow_per_1d_by_post.py
View file @
2373a7ad
...
...
@@ -16,9 +16,8 @@ def get_commnet_id(numtime, numtime2, content_level_low=0, content_level_top=3):
# 发贴后
cursor
.
execute
(
"select t.user_id from topic t left join user_extra u on t.user_id = u.user_id "
"where u.is_shadow=0 and t.create_time > '
%
s' and t.create_time < '
%
s' "
"and t.content_level >=
%
s and t.content_level <=
%
s "
%
(
numtime
,
numtime2
,
str
(
content_level_low
),
str
(
content_level_top
)))
"select user_id from topic where is_shadow!= 1 and create_time > '
%
s' and create_time < '
%
s' "
"and content_level >=
%
s and content_level <=
%
s "
%
(
numtime
,
numtime2
,
str
(
content_level_low
),
str
(
content_level_top
)))
res
=
cursor
.
fetchall
()
return
res
and
[
i
for
i
,
in
res
]
or
[]
...
...
vest/follow/auto_follow_per_1d_by_regist.py
View file @
2373a7ad
...
...
@@ -14,13 +14,14 @@ def get_commnet_id(numtime, numtime2):
cursor
=
pc
.
cursor
()
# 注册后
# todo 这个查询太慢了,加一个limit
cursor
.
execute
(
"select a.user_id from account_user a left join user_extra u on a.user_id = u.user_id "
"WHERE a.create_time > '
%
s' and a.create_time < '
%
s'
and u.is_shadow = 0
"
%
(
numtime
,
numtime2
))
"select a.user_id
, u.is_shadow
from account_user a left join user_extra u on a.user_id = u.user_id "
"WHERE a.create_time > '
%
s' and a.create_time < '
%
s'
limit 10000
"
%
(
numtime
,
numtime2
))
res
=
cursor
.
fetchall
()
return
res
and
[
i
for
i
,
in
res
]
or
[]
return
res
and
[
i
for
(
i
,
is_shadow
)
in
res
if
is_shadow
!=
1
]
or
[]
def
batch_handle
(
auto_follow_list
):
...
...
@@ -59,7 +60,8 @@ def auto_follow_per_1d_by_regist():
# 10天前注册:每隔12天[0-1]个赞
numtime1
,
numtime2
=
time_convs
(
1
,
12
)
user_ids
=
get_commnet_id
(
'0'
,
numtime2
)
# todo 加一个过滤时间
user_ids
=
get_commnet_id
(
'2019-05-11'
,
numtime2
)
for
user_id
in
user_ids
:
follow_num
=
random
.
randint
(
1
,
24
)
if
follow_num
==
12
:
...
...
vest/follow/auto_follow_per_2h_by_post_and_regist.py
View file @
2373a7ad
...
...
@@ -15,19 +15,19 @@ def get_commnet_id(numtime, numtime2, content_level_low=0, content_level_top=6):
# 发贴后
cursor
.
execute
(
"select t.user_id from topic t left join user_extra u on t.user_id = u.user_id "
"where u.is_shadow=0 and t.create_time > '
%
s' and t.create_time < '
%
s' "
"and t.content_level >=
%
s and t.content_level <=
%
s "
%
(
numtime
,
numtime2
,
str
(
content_level_low
),
str
(
content_level_top
)))
"select user_id from topic where is_shadow!= 1 and create_time > '
%
s' and create_time < '
%
s' "
"and content_level >=
%
s and content_level <=
%
s "
%
(
numtime
,
numtime2
,
str
(
content_level_low
),
str
(
content_level_top
)))
res_post
=
cursor
.
fetchall
()
# 注册后
cursor
.
execute
(
"select a.user_id from account_user a left join user_extra u on a.user_id = u.user_id "
"WHERE a.create_time > '
%
s' and a.create_time < '
%
s'
and u.is_shadow = 0
"
%
(
numtime
,
numtime2
))
"select a.user_id
, u.is_shadow
from account_user a left join user_extra u on a.user_id = u.user_id "
"WHERE a.create_time > '
%
s' and a.create_time < '
%
s' "
%
(
numtime
,
numtime2
))
res_regist
=
cursor
.
fetchall
()
res_regist
=
res_regist
and
[(
i
,)
for
(
i
,
is_shadow
)
in
res_regist
if
is_shadow
!=
1
]
or
[]
res
=
[]
res
.
extend
(
res_regist
)
...
...
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