feat:增加查询股票信息
This commit is contained in:
@@ -1,14 +1,12 @@
|
||||
import requests
|
||||
import json
|
||||
from datetime import datetime
|
||||
|
||||
from wechat_message import send_wechat_message
|
||||
|
||||
weather_url = 'https://p478kygkjw.re.qweatherapi.com/'
|
||||
weather_api_key = '4aa47f183c694aaa812ff018be8270e4'
|
||||
nanjing_location = '101190101'
|
||||
|
||||
webhook_url = 'https://qyapi.weixin.qq.com/cgi-bin/webhook/send'
|
||||
webhook_key = 'f09eb098-f709-4fc6-83b5-4a08a8431b8f'
|
||||
|
||||
|
||||
def get_today_weather(city_location: int):
|
||||
response = requests.get(
|
||||
@@ -37,19 +35,6 @@ def get_today_indices(city_location: int):
|
||||
return response.json()
|
||||
|
||||
|
||||
def send_wechat_message(message: str):
|
||||
response = requests.post(
|
||||
webhook_url,
|
||||
headers={
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
params={'key': webhook_key},
|
||||
data=json.dumps(message, ensure_ascii=False).encode('utf-8')
|
||||
)
|
||||
|
||||
return response.json()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
weather = get_today_weather(nanjing_location)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user