Skip to content

Qinglong daily weather brief script for multiple cities using QWeather web api 基于青龙面板的接入和风天气api的每日天气简报脚本

License

Notifications You must be signed in to change notification settings

ZAsprose/QWeatherDaily

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 

Repository files navigation

QWeatherDaily

English 中文

Demo Output/输出样例

Qinglong daily weather brief script for multiple cities using QWeather web api

基于青龙面板的接入和风天气api的每日天气简报脚本

中文

需要的环境变量:

qweather_key:和风天气的web api key。需要在和风天气注册账号,并在控制台中新建项目并建立web api key。将key值保存在环境变量中。 注意:此参数访问根据文档会在将来受到限制,可换成JWT认证并不需要此参数。

qweather_private_key, qweather_proj_id, qweather_private_key_id: 以上3个变量为JWT所需的参数,需要在和风天气的控制台的项目中获取,详情见相应开发文档

city_list_str:一组由经纬度或城市(地区)信息构成的字符串,每个地点之间用英文引号分隔。

经纬度:用英文逗号分隔的经度,纬度坐标

信息:为了查找精确,本项目采取三段字符串,每个信息用英文逗号分隔。分别是“关键词,省份/上级行政区划,搜索范围(ISO 3166 所定义的国家代码)”

详细说明在 https://dev.qweather.com/docs/api/geoapi/city-lookup/

范例:"茶陵,湖南,cn;melbourne,victoria,au;144.96,-37.82"

脚本内变量:

lang: 从api获取的信息语言,目前代码内设定为中文。相应开发文档

alarm_dic: 需要在信息开头进行提示的天气的关键字数组

hours_needed:需要获取天气的小时数。例如如果在6点开始定时项目,只关注今天的天气,则可设为18。脚本内设为24

脚本的通知是引用了青龙自带的notify方式发送。

English

qinglong enviroment param needed:

qweather_key: web api key from qweather.com. In offical document, developer should use JWT instead, and this param will not be needed.

qweather_private_key, qweather_proj_id, qweather_private_key_id: 3 params for JWT. They should be granted from console of qweather. Reference to QWeather Doc Authentication

city_list_str: a string combined by a set of values of longitude,latitude or keyword,Superior administrative divisions of a city,a certain country or region using country code ISO 3166. Reference to QWeather GeoAPI Doc. e.g.:"茶陵,湖南,cn;melbourne,victoria,au;144.96,-37.82"

params in the script:

lang: language of the context from Qweather, in the scirpt is now Chinese. Refer to QWeather doc

alarm_dic: keywords that would trigger an alarm in the head of the message

hours_needed:numbers of hour you need. Say if your task starts at 8 am, the api would fetch the following 24h data from 9 am to 7pm tomorrow, so only 9am to 12 pm, overall 15 data is needed for today's notification. In the script is now 24

This scirpt uses qinglong defaultly notify way. Also all build-in message of this script is Chinese.

DemoOutput

【坏天气】茶陵 墨尔本

【茶陵】小雨 【墨尔本】小雨

【茶陵】 温度: 22.0 - 24.0度 16:00 - 21:00: 多云 21:00 - 01:00: 小雨 16:00 - 21:00: 多云 21:00 - 01:00: 小雨 详细: https://www.qweather.com/weather/chaling-101250305.html

【墨尔本】 温度: 7.0 - 11.0度 18:00 - 20:00: 多云 20:00 - 23:00: 小雨 23:00 - 00:00: 多云 00:00 - 02:00: 小雨 02:00 - 03:00: 多云 18:00 - 20:00: 多云 20:00 - 23:00: 小雨 23:00 - 00:00: 多云 00:00 - 02:00: 小雨 02:00 - 03:00: 多云 详细: https://www.qweather.com/weather/melbourne-754D9.html

About

Qinglong daily weather brief script for multiple cities using QWeather web api 基于青龙面板的接入和风天气api的每日天气简报脚本

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages