|
|
@@ -6,6 +6,7 @@ import sys
|
|
|
from weather import all_city
|
|
|
import logging
|
|
|
import django
|
|
|
+import time
|
|
|
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
|
|
sys.path.append(BASE_DIR)
|
|
|
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'bigdataAPI.settings')
|
|
|
@@ -100,7 +101,7 @@ def main():
|
|
|
district = temp
|
|
|
|
|
|
try:
|
|
|
- today_url = f"https://v0.yiketianqi.com/api?unescape=1&version=v62&appid={app_id}&appsecret={app_secret}&adcode={city_id}"
|
|
|
+ today_url = f"http://v0.yiketianqi.com/api?unescape=1&version=v62&appid=69334222&appsecret=2u4bHXHD&adcode={city_id}"
|
|
|
today_response = requests.get(today_url, timeout=5)
|
|
|
today_data = json.loads(today_response.text)
|
|
|
if "errcode" not in today_data.keys():
|
|
|
@@ -115,7 +116,7 @@ def main():
|
|
|
"content": str(today_data)
|
|
|
}
|
|
|
)
|
|
|
- server_day_url = f"https://v0.yiketianqi.com/api?unescape=1&version=v91&appid={app_id}&appsecret={app_secret}&adcode={city_id}&ext=hours,aqi,life"
|
|
|
+ server_day_url = f"http://v0.yiketianqi.com/api?unescape=1&version=v91&appid={app_id}&appsecret={app_secret}&adcode={city_id}&ext=hours,aqi,life"
|
|
|
server_day_response = requests.get(server_day_url, timeout=5)
|
|
|
server_day_data = json.loads(server_day_response.text)
|
|
|
if "errcode" not in server_day_data.keys():
|