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
e9789cd3
Commit
e9789cd3
authored
Sep 11, 2019
by
lixiaofang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add
parent
21c2c19a
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
17 deletions
+11
-17
auto_request.py
vest/request/auto_request.py
+6
-10
get_session.py
vest/request/get_session.py
+3
-5
vest_click_reply.py
vest/vest_majiauser/vest_click_reply.py
+2
-2
No files found.
vest/request/auto_request.py
View file @
e9789cd3
...
...
@@ -14,20 +14,16 @@ from physical.settings_local import DATABASES
from
physical.settings_local
import
REDIS_URL
from
vest.data.topic_models
import
get_pictorial_tag_by_id
,
get_topic_product_info
,
get_edit_tag_id_list
,
\
get_category_tag_id
,
topic_has_image
from
django.conf
import
settings
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.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
=
settings
.
auto_click_url
auto_reply_url
=
settings
.
auto_reply_url
auto_follow_url
=
settings
.
auto_follow_url
auto_urge_url
=
settings
.
auto_urge_url
host
=
DATABASES
[
'default'
][
'HOST'
]
...
...
@@ -318,7 +314,7 @@ def send_email(stat_data):
msg
=
MIMEText
(
stat_data
,
'plain'
,
'utf-8'
)
msg
[
'From'
]
=
formataddr
([
"李小芳"
,
my_sender
])
msg
[
"To"
]
=
formataddr
([
"李小芳"
,
my_user6
])
msg
[
'Subject'
]
=
str
(
datetime
.
date
.
today
())
+
"like的
线上
环境的自动点赞出问题了"
msg
[
'Subject'
]
=
str
(
datetime
.
date
.
today
())
+
"like的
"
+
str
(
settings
.
service_name
)
+
"
环境的自动点赞出问题了"
server
=
smtplib
.
SMTP_SSL
(
"smtp.exmail.qq.com"
,
465
)
server
.
login
(
my_sender
,
my_pass
)
server
.
sendmail
(
my_sender
,
[
my_user6
],
msg
.
as_string
())
...
...
vest/request/get_session.py
View file @
e9789cd3
...
...
@@ -4,14 +4,12 @@ import logging
import
json
from
libs.cache
import
redis_client
from
libs.error
import
logging_exception
login_url
=
"http://earth.iyanzhi.com/api/account/login_pwd"
# login_url = "http://earth.gmapp.env/api/account/login_pwd"
from
django.conf
import
settings
def
index_first
():
try
:
r1
=
requests
.
get
(
login_url
)
r1
=
requests
.
get
(
settings
.
login_url
)
return
r1
.
cookies
.
get_dict
()
except
:
logging
.
error
(
"index_first:
%
s"
%
traceback
.
format_exc
())
...
...
@@ -33,7 +31,7 @@ def get_cook():
'email'
:
i
}
response
=
requests
.
post
(
url
=
login_url
,
url
=
settings
.
login_url
,
data
=
post_dict
,
cookies
=
cookies
)
...
...
vest/vest_majiauser/vest_click_reply.py
View file @
e9789cd3
...
...
@@ -9,8 +9,8 @@ from libs.cache import redis_client
from
vest.request.auto_request
import
get_offline_comment
from
vest.request.auto_request
import
host
,
user
,
db
,
passwd
from
libs.error
import
logging_exception
from
django.conf
import
settings
auto_reply_url
=
"http://saturn.iyanzhi.com/api/v1/reply/create_for_inner"
def
reply
(
id
,
content
,
user_id
):
...
...
@@ -21,7 +21,7 @@ def reply(id, content, user_id):
'content'
:
content
,
"type"
:
4
}
response
=
requests
.
post
(
url
=
auto
_reply_url
,
response
=
requests
.
post
(
url
=
settings
.
auto_inner
_reply_url
,
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