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
12d07f1f
Commit
12d07f1f
authored
Oct 14, 2019
by
吴升宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix auto_click
parent
af551d03
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
13 deletions
+52
-13
auto_click_per_1d_by_post.py
vest/click/auto_click_per_1d_by_post.py
+15
-2
auto_click_per_2h_by_post.py
vest/click/auto_click_per_2h_by_post.py
+16
-4
auto_request.py
vest/request/auto_request.py
+21
-7
No files found.
vest/click/auto_click_per_1d_by_post.py
View file @
12d07f1f
...
...
@@ -12,6 +12,8 @@ def get_commnet_id(numtime, numtime2, content_level_low=0, content_level_top=6):
pc
=
pymysql
.
connect
(
host
=
host
,
user
=
user
,
passwd
=
passwd
,
db
=
db
,
port
=
3306
)
cursor
=
pc
.
cursor
()
topic_ids
=
[]
cursor
.
execute
(
"select t.id from topic t left join user_extra u on t.user_id = u.user_id "
...
...
@@ -20,7 +22,18 @@ def get_commnet_id(numtime, numtime2, content_level_low=0, content_level_top=6):
res
=
cursor
.
fetchall
()
return
res
and
[
i
for
i
,
in
res
]
or
[]
for
i
,
in
res
:
cursor
.
execute
(
"SELECT pictorial_id FROM community_pictorial_topic where topic_id=
%
s limit 1"
%
i
)
pictorial_id
=
cursor
.
fetchall
()
if
pictorial_id
is
not
None
:
topic_ids
.
append
((
i
,
pictorial_id
[
0
]))
else
:
topic_ids
.
append
((
i
,
0
))
return
topic_ids
def
batch_handle
(
auto_click_list
):
...
...
@@ -84,7 +97,7 @@ def auto_click_per_1d_by_post():
topic_ids
=
get_commnet_id
(
'0'
,
numtime2
,
content_level_low
=
4
,
content_level_top
=
6
)
for
topic_id
in
topic_ids
:
click_num
=
random
.
randint
(
1
,
3
)
if
click_num
==
3
:
if
click_num
==
1
:
auto_click_list
.
append
(
topic_id
)
except
:
...
...
vest/click/auto_click_per_2h_by_post.py
View file @
12d07f1f
...
...
@@ -12,6 +12,8 @@ def get_commnet_id(numtime, numtime2, content_level_low=0, content_level_top=6):
pc
=
pymysql
.
connect
(
host
=
host
,
user
=
user
,
passwd
=
passwd
,
db
=
db
,
port
=
3306
)
cursor
=
pc
.
cursor
()
topic_ids
=
[]
# 发贴后
cursor
.
execute
(
...
...
@@ -21,7 +23,18 @@ def get_commnet_id(numtime, numtime2, content_level_low=0, content_level_top=6):
res
=
cursor
.
fetchall
()
return
res
and
[
i
for
i
,
in
res
]
or
[]
for
i
,
in
res
:
cursor
.
execute
(
"SELECT pictorial_id FROM community_pictorial_topic where topic_id=
%
s limit 1"
%
i
)
pictorial_id
=
cursor
.
fetchall
()
if
pictorial_id
is
not
None
:
topic_ids
.
append
((
i
,
pictorial_id
[
0
]))
else
:
topic_ids
.
append
((
i
,
0
))
return
topic_ids
def
batch_handle
(
auto_click_list
):
...
...
@@ -46,13 +59,12 @@ def auto_click_per_2h_by_post():
for
i
in
range
(
click_num
):
auto_click_list
.
append
(
topic_id
)
except
:
logging_exception
()
logging
.
error
(
"catch exception,main:
%
s"
%
traceback
.
format_exc
())
logging
.
info
(
'auto_
follow_per_2h_by_post_and_regi
st: len
%
s'
%
len
(
auto_click_list
))
print
(
'auto_
follow_per_2h_by_post_and_regi
st: len
%
s'
%
len
(
auto_click_list
))
logging
.
info
(
'auto_
click_per_2h_by_po
st: len
%
s'
%
len
(
auto_click_list
))
print
(
'auto_
click_per_2h_by_po
st: len
%
s'
%
len
(
auto_click_list
))
total
=
len
(
auto_click_list
)
limit
=
(
total
+
10
)
//
10
...
...
vest/request/auto_request.py
View file @
12d07f1f
...
...
@@ -20,6 +20,7 @@ my_sender = 'lixiaofang@igengmei.com'
my_pass
=
'tg5AVKBB8jLQGBET'
my_user6
=
"lixiaofang@igengmei.com"
auto_vote_url
=
settings
.
AUTO_VOTE_URL
auto_click_url
=
settings
.
AUTO_CLICK_URL
auto_reply_url
=
settings
.
AUTO_REPLY_URL
auto_follow_url
=
settings
.
AUTO_FOLLOW_URL
...
...
@@ -115,13 +116,26 @@ def logins(user_id):
def
click
(
cookies_get
,
id
):
# 点赞
try
:
post_dict
=
{
'type'
:
0
,
'id'
:
id
}
response
=
requests
.
post
(
url
=
auto_click_url
,
cookies
=
cookies_get
,
data
=
post_dict
)
topic_id
=
id
[
0
]
pictorial_id
=
id
[
1
]
if
pictorial_id
:
post_dict
=
{
"topic_id"
:
topic_id
,
"pictorial_id"
:
pictorial_id
}
response
=
requests
.
post
(
url
=
auto_vote_url
,
cookies
=
cookies_get
,
data
=
post_dict
)
else
:
post_dict
=
{
'type'
:
0
,
'id'
:
topic_id
}
response
=
requests
.
post
(
url
=
auto_click_url
,
cookies
=
cookies_get
,
data
=
post_dict
)
logging
.
info
(
"response.text:
%
s"
%
response
.
text
)
...
...
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