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
alpha
physical
Commits
d07f21c9
Commit
d07f21c9
authored
Oct 10, 2019
by
吴升宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix auto_follow_per_5m_by_followed
parent
8e17c112
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
7 deletions
+9
-7
majia_user_ids.py
vest/data/majia_user_ids.py
+0
-0
auto_follow_per_5m_by_followed.py
vest/follow/auto_follow_per_5m_by_followed.py
+6
-5
auto_request.py
vest/request/auto_request.py
+3
-2
No files found.
vest/data/majia_user_ids.py
View file @
d07f21c9
This diff is collapsed.
Click to expand it.
vest/follow/auto_follow_per_5m_by_followed.py
View file @
d07f21c9
...
@@ -3,7 +3,7 @@ import traceback
...
@@ -3,7 +3,7 @@ import traceback
import
logging
import
logging
from
vest.request.auto_request
import
login
,
follow
,
time_conv
from
vest.request.auto_request
import
login
,
follow
,
time_conv
from
vest.request.auto_request
import
host
,
user
,
db
,
passwd
from
vest.request.auto_request
import
host
,
user
,
db
,
passwd
from
vest.data.majia_user_ids
import
majia_user_ids_list
from
vest.data.majia_user_ids
import
majia_user_ids_list
,
majia_user_ids_dict
from
libs.error
import
logging_exception
from
libs.error
import
logging_exception
...
@@ -12,7 +12,7 @@ def get_user_id(numtime):
...
@@ -12,7 +12,7 @@ def get_user_id(numtime):
cursor
=
pc
.
cursor
()
cursor
=
pc
.
cursor
()
majia_user_ids_tuple
=
tuple
(
majia_user_ids_list
)
majia_user_ids_tuple
=
tuple
(
majia_user_ids_list
)
cursor
.
execute
(
cursor
.
execute
(
"SELECT user_id FROM user_follow WHERE create_time > '
%
s' and follow_id in
%
s "
%
(
numtime
,
str
(
majia_user_ids_tuple
))
"SELECT user_id
, follow_id
FROM user_follow WHERE create_time > '
%
s' and follow_id in
%
s "
%
(
numtime
,
str
(
majia_user_ids_tuple
))
)
)
data_comment
=
cursor
.
fetchall
()
data_comment
=
cursor
.
fetchall
()
return
data_comment
and
[
i
for
i
in
data_comment
]
or
[]
return
data_comment
and
[
i
for
i
in
data_comment
]
or
[]
...
@@ -22,10 +22,11 @@ def auto_follow_per_5m_by_followed():
...
@@ -22,10 +22,11 @@ def auto_follow_per_5m_by_followed():
# 如果马甲被用户关注,马甲即反向关注用户, 被关注5分钟后
# 如果马甲被用户关注,马甲即反向关注用户, 被关注5分钟后
try
:
try
:
numtime1
,
numtime2
=
time_conv
(
1
,
5
)
numtime1
,
numtime2
=
time_conv
(
1
,
5
)
user
_id
s
=
get_user_id
(
numtime2
)
users
=
get_user_id
(
numtime2
)
try
:
try
:
for
user_id
in
user_ids
and
user_ids
:
for
user
in
users
and
users
:
cookies
=
login
()
user_id
=
user
[
0
]
cookies
=
login
(
majia_user_ids_dict
.
get
(
user
[
1
]))
if
cookies
is
not
None
:
if
cookies
is
not
None
:
follow
(
cookies
,
user_id
)
follow
(
cookies
,
user_id
)
except
:
except
:
...
...
vest/request/auto_request.py
View file @
d07f21c9
...
@@ -82,9 +82,10 @@ def get_cookies(user_id):
...
@@ -82,9 +82,10 @@ def get_cookies(user_id):
return
None
return
None
def
login
():
def
login
(
user_id
=
None
):
try
:
try
:
user_id
=
get_majia
()
if
not
user_id
:
user_id
=
get_majia
()
logging
.
info
(
"get user_id:
%
s"
%
user_id
)
logging
.
info
(
"get user_id:
%
s"
%
user_id
)
cookies
=
get_cookies
(
user_id
)
cookies
=
get_cookies
(
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