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
21c2c19a
Commit
21c2c19a
authored
Sep 11, 2019
by
lixiaofang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ad
parent
a7372f4a
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
256 additions
and
8 deletions
+256
-8
__init__.py
vest/change_reply/__init__.py
+0
-0
before_yesterday_topic_reply.py
vest/change_reply/before_yesterday_topic_reply.py
+49
-0
five_days_ago_topic_reply.py
vest/change_reply/five_days_ago_topic_reply.py
+49
-0
seven_days_ago_reply.py
vest/change_reply/seven_days_ago_reply.py
+49
-0
three_days_ago_topic_reply.py
vest/change_reply/three_days_ago_topic_reply.py
+49
-0
yesterday_topic_reply.py
vest/change_reply/yesterday_topic_reply.py
+49
-0
auto_request.py
vest/request/auto_request.py
+11
-8
No files found.
vest/change_reply/__init__.py
0 → 100644
View file @
21c2c19a
vest/change_reply/before_yesterday_topic_reply.py
0 → 100644
View file @
21c2c19a
import
pymysql
import
traceback
import
logging
from
vest.request.auto_request
import
logins
,
time_convs
,
get_comment
,
reply
,
get_product_comment
,
get_face_comment
,
\
get_category_tag_id
,
get_category_reply_commtent
,
judge_topic_info_get_comment
,
get_majia_reply
from
vest.request.auto_request
import
host
,
user
,
db
,
passwd
from
libs.error
import
logging_exception
from
vest.data.topic_models
import
get_edit_tag_id_list
,
get_pictorial_tag_by_id
,
get_topic_product_info
,
\
topic_has_image
import
random
def
get_data
(
numtime
,
numtime2
):
try
:
print
(
"...."
)
pc
=
pymysql
.
connect
(
host
=
host
,
user
=
user
,
passwd
=
passwd
,
db
=
db
,
port
=
3306
)
cursor
=
pc
.
cursor
()
cursor
.
execute
(
"SELECT user_id,id FROM topic WHERE (create_time > '
%
s' and create_time < '
%
s' ) and is_online=1 "
%
(
numtime
,
numtime2
))
data
=
cursor
.
fetchall
()
topic_id_list
=
list
(
data
)
return
topic_id_list
except
:
logging
.
error
(
"catch exception,get_data:
%
s"
%
traceback
.
format_exc
())
return
[]
def
before_yesterday_comment_one
():
try
:
logging
.
info
(
"comment one"
)
numtime
,
numtime2
=
time_convs
(
2
,
1
)
topic_id_list
=
get_data
(
numtime
,
numtime2
)
if
topic_id_list
:
for
i
in
topic_id_list
:
random_num
=
random
.
randint
(
0
,
2
)
logging
.
info
(
"get random_num:
%
s"
%
random_num
)
for
num
in
range
(
random_num
):
majia_user_id
=
get_majia_reply
(
i
[
0
])
cook
=
logins
(
majia_user_id
)
comment
=
judge_topic_info_get_comment
(
i
[
1
])
if
cook
is
not
None
:
reply
(
cook
,
i
[
1
],
comment
)
else
:
logging
.
error
(
"catch exception,main:
%
s"
%
traceback
.
format_exc
())
except
:
logging_exception
()
logging
.
error
(
"catch exception,main:
%
s"
%
traceback
.
format_exc
())
vest/change_reply/five_days_ago_topic_reply.py
0 → 100644
View file @
21c2c19a
import
pymysql
import
traceback
import
logging
from
vest.request.auto_request
import
logins
,
time_convs
,
get_comment
,
reply
,
get_product_comment
,
get_face_comment
,
\
get_category_tag_id
,
get_category_reply_commtent
,
judge_topic_info_get_comment
,
get_majia_reply
from
vest.request.auto_request
import
host
,
user
,
db
,
passwd
from
libs.error
import
logging_exception
from
vest.data.topic_models
import
get_edit_tag_id_list
,
get_pictorial_tag_by_id
,
get_topic_product_info
,
\
topic_has_image
import
random
def
get_data
(
numtime
,
numtime2
):
try
:
print
(
"...."
)
pc
=
pymysql
.
connect
(
host
=
host
,
user
=
user
,
passwd
=
passwd
,
db
=
db
,
port
=
3306
)
cursor
=
pc
.
cursor
()
cursor
.
execute
(
"SELECT user_id,id FROM topic WHERE (create_time > '
%
s' and create_time < '
%
s' ) and is_online=1 "
%
(
numtime
,
numtime2
))
data
=
cursor
.
fetchall
()
topic_id_list
=
list
(
data
)
return
topic_id_list
except
:
logging
.
error
(
"catch exception,get_data:
%
s"
%
traceback
.
format_exc
())
return
[]
def
five_days_ago_comment_one
():
try
:
logging
.
info
(
"comment one"
)
numtime
,
numtime2
=
time_convs
(
5
,
1
)
topic_id_list
=
get_data
(
numtime
,
numtime2
)
if
topic_id_list
:
for
i
in
topic_id_list
:
random_num
=
random
.
randint
(
0
,
2
)
logging
.
info
(
"get random_num:
%
s"
%
random_num
)
for
num
in
range
(
random_num
):
majia_user_id
=
get_majia_reply
(
i
[
0
])
cook
=
logins
(
majia_user_id
)
comment
=
judge_topic_info_get_comment
(
i
[
1
])
if
cook
is
not
None
:
reply
(
cook
,
i
[
1
],
comment
)
else
:
logging
.
error
(
"catch exception,main:
%
s"
%
traceback
.
format_exc
())
except
:
logging_exception
()
logging
.
error
(
"catch exception,main:
%
s"
%
traceback
.
format_exc
())
vest/change_reply/seven_days_ago_reply.py
0 → 100644
View file @
21c2c19a
import
pymysql
import
traceback
import
logging
from
vest.request.auto_request
import
logins
,
time_convs
,
get_comment
,
reply
,
get_product_comment
,
get_face_comment
,
\
get_category_tag_id
,
get_category_reply_commtent
,
judge_topic_info_get_comment
,
get_majia_reply
from
vest.request.auto_request
import
host
,
user
,
db
,
passwd
from
libs.error
import
logging_exception
from
vest.data.topic_models
import
get_edit_tag_id_list
,
get_pictorial_tag_by_id
,
get_topic_product_info
,
\
topic_has_image
import
random
def
get_data
(
numtime
,
numtime2
):
try
:
print
(
"...."
)
pc
=
pymysql
.
connect
(
host
=
host
,
user
=
user
,
passwd
=
passwd
,
db
=
db
,
port
=
3306
)
cursor
=
pc
.
cursor
()
cursor
.
execute
(
"SELECT user_id,id FROM topic WHERE (create_time > '
%
s' and create_time < '
%
s' ) and is_online=1 "
%
(
numtime
,
numtime2
))
data
=
cursor
.
fetchall
()
topic_id_list
=
list
(
data
)
return
topic_id_list
except
:
logging
.
error
(
"catch exception,get_data:
%
s"
%
traceback
.
format_exc
())
return
[]
def
serven_days_ago_comment_one
():
try
:
logging
.
info
(
"comment one"
)
numtime
,
numtime2
=
time_convs
(
7
,
1
)
topic_id_list
=
get_data
(
numtime
,
numtime2
)
if
topic_id_list
:
for
i
in
topic_id_list
:
random_num
=
random
.
randint
(
0
,
2
)
logging
.
info
(
"get random_num:
%
s"
%
random_num
)
for
num
in
range
(
random_num
):
majia_user_id
=
get_majia_reply
(
i
[
0
])
cook
=
logins
(
majia_user_id
)
comment
=
judge_topic_info_get_comment
(
i
[
1
])
if
cook
is
not
None
:
reply
(
cook
,
i
[
1
],
comment
)
else
:
logging
.
error
(
"catch exception,main:
%
s"
%
traceback
.
format_exc
())
except
:
logging_exception
()
logging
.
error
(
"catch exception,main:
%
s"
%
traceback
.
format_exc
())
vest/change_reply/three_days_ago_topic_reply.py
0 → 100644
View file @
21c2c19a
import
pymysql
import
traceback
import
logging
from
vest.request.auto_request
import
logins
,
time_convs
,
get_comment
,
reply
,
get_product_comment
,
get_face_comment
,
\
get_category_tag_id
,
get_category_reply_commtent
,
judge_topic_info_get_comment
,
get_majia_reply
from
vest.request.auto_request
import
host
,
user
,
db
,
passwd
from
libs.error
import
logging_exception
from
vest.data.topic_models
import
get_edit_tag_id_list
,
get_pictorial_tag_by_id
,
get_topic_product_info
,
\
topic_has_image
import
random
def
get_data
(
numtime
,
numtime2
):
try
:
print
(
"...."
)
pc
=
pymysql
.
connect
(
host
=
host
,
user
=
user
,
passwd
=
passwd
,
db
=
db
,
port
=
3306
)
cursor
=
pc
.
cursor
()
cursor
.
execute
(
"SELECT user_id,id FROM topic WHERE (create_time > '
%
s' and create_time < '
%
s' ) and is_online=1 "
%
(
numtime
,
numtime2
))
data
=
cursor
.
fetchall
()
topic_id_list
=
list
(
data
)
return
topic_id_list
except
:
logging
.
error
(
"catch exception,get_data:
%
s"
%
traceback
.
format_exc
())
return
[]
def
three_days_ago_comment_one
():
try
:
logging
.
info
(
"comment one"
)
numtime
,
numtime2
=
time_convs
(
3
,
1
)
topic_id_list
=
get_data
(
numtime
,
numtime2
)
if
topic_id_list
:
for
i
in
topic_id_list
:
random_num
=
random
.
randint
(
0
,
2
)
logging
.
info
(
"get random_num:
%
s"
%
random_num
)
for
num
in
range
(
random_num
):
majia_user_id
=
get_majia_reply
(
i
[
0
])
cook
=
logins
(
majia_user_id
)
comment
=
judge_topic_info_get_comment
(
i
[
1
])
if
cook
is
not
None
:
reply
(
cook
,
i
[
1
],
comment
)
else
:
logging
.
error
(
"catch exception,main:
%
s"
%
traceback
.
format_exc
())
except
:
logging_exception
()
logging
.
error
(
"catch exception,main:
%
s"
%
traceback
.
format_exc
())
vest/change_reply/yesterday_topic_reply.py
0 → 100644
View file @
21c2c19a
import
pymysql
import
traceback
import
logging
from
vest.request.auto_request
import
logins
,
time_convs
,
get_comment
,
reply
,
get_product_comment
,
get_face_comment
,
\
get_category_tag_id
,
get_category_reply_commtent
,
judge_topic_info_get_comment
,
get_majia_reply
from
vest.request.auto_request
import
host
,
user
,
db
,
passwd
from
libs.error
import
logging_exception
from
vest.data.topic_models
import
get_edit_tag_id_list
,
get_pictorial_tag_by_id
,
get_topic_product_info
,
\
topic_has_image
import
random
def
get_data
(
numtime
,
numtime2
):
try
:
print
(
"...."
)
pc
=
pymysql
.
connect
(
host
=
host
,
user
=
user
,
passwd
=
passwd
,
db
=
db
,
port
=
3306
)
cursor
=
pc
.
cursor
()
cursor
.
execute
(
"SELECT user_id,id FROM topic WHERE (create_time > '
%
s' and create_time < '
%
s' ) and is_online=1 "
%
(
numtime
,
numtime2
))
data
=
cursor
.
fetchall
()
topic_id_list
=
list
(
data
)
return
topic_id_list
except
:
logging
.
error
(
"catch exception,get_data:
%
s"
%
traceback
.
format_exc
())
return
[]
def
yesterday_comment_one
():
try
:
logging
.
info
(
"comment one"
)
numtime
,
numtime2
=
time_convs
(
1
,
1
)
topic_id_list
=
get_data
(
numtime
,
numtime2
)
if
topic_id_list
:
for
i
in
topic_id_list
:
random_num
=
random
.
randint
(
0
,
2
)
logging
.
info
(
"get random_num:
%
s"
%
random_num
)
for
num
in
range
(
random_num
):
majia_user_id
=
get_majia_reply
(
i
[
0
])
cook
=
logins
(
majia_user_id
)
comment
=
judge_topic_info_get_comment
(
i
[
1
])
if
cook
is
not
None
:
reply
(
cook
,
i
[
1
],
comment
)
else
:
logging
.
error
(
"catch exception,main:
%
s"
%
traceback
.
format_exc
())
except
:
logging_exception
()
logging
.
error
(
"catch exception,main:
%
s"
%
traceback
.
format_exc
())
vest/request/auto_request.py
View file @
21c2c19a
...
...
@@ -19,15 +19,15 @@ my_sender = 'lixiaofang@igengmei.com'
my_pass
=
'tg5AVKBB8jLQGBET'
my_user6
=
"lixiaofang@igengmei.com"
#
auto_click_url = "http://earth.gmapp.env/api/v1/like"
#
auto_reply_url = "http://earth.gmapp.env/api/v1/reply/create"
#
auto_follow_url = "http://earth.gmapp.env/api/v1/follow"
#
auto_urge_url = "http://earth.gmapp.env/api/v1/user/urge"
auto_click_url
=
"http://earth.gmapp.env/api/v1/like"
auto_reply_url
=
"http://earth.gmapp.env/api/v1/reply/create"
auto_follow_url
=
"http://earth.gmapp.env/api/v1/follow"
auto_urge_url
=
"http://earth.gmapp.env/api/v1/user/urge"
auto_click_url
=
"http://earth.iyanzhi.com/api/v1/like"
auto_reply_url
=
"http://earth.iyanzhi.com/api/v1/reply/create"
auto_follow_url
=
"http://earth.iyanzhi.com/api/v1/follow"
auto_urge_url
=
"http://earth.iyanzhi.com/api/v1/user/urge"
#
auto_click_url = "http://earth.iyanzhi.com/api/v1/like"
#
auto_reply_url = "http://earth.iyanzhi.com/api/v1/reply/create"
#
auto_follow_url = "http://earth.iyanzhi.com/api/v1/follow"
#
auto_urge_url = "http://earth.iyanzhi.com/api/v1/user/urge"
host
=
DATABASES
[
'default'
][
'HOST'
]
...
...
@@ -192,6 +192,9 @@ def time_convs(numtime, numtime2):
yes_time_str2
=
yes_time2
.
strftime
(
'
%
Y-
%
m-
%
d'
)
yes_time_str2
=
yes_time_str2
+
' 00:00:00.000000'
logging
.
info
(
"get yes_time_str:
%
s"
%
yes_time_str
)
logging
.
info
(
"get yes_time_str2:
%
s"
%
yes_time_str2
)
return
yes_time_str
,
yes_time_str2
except
:
return
None
...
...
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