Last updated: 2026-03-25 13:45:51
這是一個使用 Python Flask 開發的天氣查詢網頁應用,整合了 OpenWeatherMap API 來獲取即時天氣數據,並使用 GitHub Actions 實現自動更新功能。
下載專案:
git clone https://github.com/bohuailai/weather.github.io.git cd weather.github.io
安裝套件:
pip install -r requirements.txt
設置環境變數:
.env
OPENWEATHER_API_KEY=你的OpenWeatherMap_API密鑰
執行程式:
python app.py
開啟瀏覽器:
http://localhost:5000
在 GitHub 倉庫中設置 API 密鑰:
OPENWEATHER_API_KEY
自動更新功能:
weather_data.json
手動觸發更新:
顯示資訊包括:
自動更新數據:
版权所有:中国计算机学会技术支持:开源发展技术委员会 京ICP备13000930号-9 京公网安备 11010802032778号
天氣查詢應用
這是一個使用 Python Flask 開發的天氣查詢網頁應用,整合了 OpenWeatherMap API 來獲取即時天氣數據,並使用 GitHub Actions 實現自動更新功能。
功能特點
系統要求
安裝步驟
下載專案:
安裝套件:
設置環境變數:
.env文件執行程式:
開啟瀏覽器:
GitHub Actions 自動更新
在 GitHub 倉庫中設置 API 密鑰:
OPENWEATHER_API_KEY自動更新功能:
weather_data.json文件中手動觸發更新:
使用說明
顯示資訊包括:
自動更新數據:
weather_data.json文件會自動更新注意事項