优化均价算法

This commit is contained in:
2018-03-12 15:20:21 +08:00
parent 6caa0b07e6
commit c351000c5b
3 changed files with 56 additions and 14 deletions
+17
View File
@@ -5,6 +5,8 @@ import config
import pytz
import datetime
import calendar
import requests
import json
from fangjia import mongoClients as mongoClients
from fangjia import ElasticsearchClient as es
@@ -90,6 +92,21 @@ def get_weekend():
return pacific.localize(now)
def send_ding_msg(msg):
headers = {
'Content-Type': "application/json",
}
url = "https://oapi.dingtalk.com/robot/send" \
"?access_token=2307d2fec8314b3e8b4b83dd1d42da2e2051638e3e668f21e77ca01258bf682c"
text_body = {
"msgtype": "text",
"text": {
"content": msg
}
}
requests.request("POST", url, data=json.dumps(text_body, ensure_ascii=False).encode('utf8'), headers=headers)
@timer