刚安装好这个桌面插件的时候, 我画红线的这个部分是无法显示天气数值的,我就在网上找了别人的代码来参考,
这是参考的博客:https://blog.csdn.net/Hugo_1st/article/details/106084414
[Variables] @include=#@#Variables.inc @include2=#@#Language\Language.inc @Include3=#@#WXDataWeatherRegExp.inc Scale=0.35 Location=https://tianqi.moji.com/weather/china/guangxi/lingchuan-county 这里放上你所在地区的URL ;------------------------------------------------------------- ;------------------------------------------------------------- [WeatherParent] Measure=Plugin Plugin=WebParser.dll URL=#Location# RegExp="(?siU)<div class="wea_weather clearfix">.*<em>(.*)</em>" StringIndex=1 UpdateRate=900 ForceReload=1 FinishAction=[!EnableMeasureGroup Weather][!UpdateMeter *][!Redraw]
这是我更改过后的代码,原来的代码为:
[Variables] @include=#@#Variables.inc @include2=#@#Language\Language.inc @Include3=#@#WXDataWeatherRegExp.inc Scale=0.35;------------------------------------------------------------- ;------------------------------------------------------------- [WeatherParent] Measure=Plugin Plugin=WebParser URL=#某个URL# RegExp=(?siU)^(.*)$ UpdateRate=900 ForceReload=1 FinishAction=[!EnableMeasureGroup Weather][!UpdateMeter *][!Redraw]
参考的博客的博主使用的是墨迹天气的数据,通过RegExp匹配HTML的元素。
而我更改后还没搞定,还没显示天气,我认为是他之后的元素不断的引用传递时出现错误
[CurrentConditionsParent] Measure=Plugin Group=Weather Plugin=WebParser URL=[WeatherParent] RegExp=#CurrentConditions# Disabled=1 [CurrentTempChild] Measure=Plugin Group=Weather Plugin=WebParser URL=[CurrentConditionsParent] StringIndex=3 Disabled=1 [UnitsParent] Measure=Plugin Group=Weather Plugin=WebParser URL=[WeatherParent] RegExp=#UnitsOfMeasure# Disabled=1 [UnitsTempChild] Measure=Plugin Group=Weather Plugin=WebParser URL=[UnitsParent] StringIndex=3 Disabled=1
这些都是不断的引用第一段所获取到的数据,所以我决定直接在显示数据的变量调用第一段的数据,不调用引用之后的数据
[MeterInfo] Meter=String MeasureName=MeasureDate MeasureName2=MeasureDate2 MeasureName3=MeasureMonth MeasureName4=MeasureDayOfYear MeasureName5=CurrentConditionsChild MeasureName6=WeatherParent 更改了这里,直接调用第一段数据 MeasureName7=UnitsTempChild MeasureName8=MeasureCPU MeasureName9=MeasurePhysMemUsed StringAlign=Center FontFace=Quicksand Light FontColor=#Color1# FontSize=(35*#Scale#) X=(0*#Scale#)r Y=(200*#Scale#) Text="#Welcome back again#. #Today is# %1%2 %3, %4 #day of the year#.#CRLF##Weather today is# %5 #with temperature# %6 °%7.#CRLF##Cpu usage is# %8%. #Ram usage is# %9%." InlinePattern=[MeasureMonth] InlineSetting=Color | #Color2# InlinePattern2=[CurrentConditionsChild] InlineSetting2=Color | #Color2# DynamicVariables=1 AntiAlias=1 Percentual=1 Hidden=#Hidden#
在更改完这部分之后,刷新皮肤就能看见所在地区的天气气温了
雨滴桌面Bellana插件weather无法显示天气的解决方法
原文:https://www.cnblogs.com/XCCCCCC/p/12987744.html