天气代码,求大神一阅,提点。
rainmeter吧
全部回复
仅看楼主
level 1
MsJustvii 楼主
;[BEGIN CONFIG FILE]==============================
[Rainmeter]
Author=NLAIWW
Version=1.1
AppVersion=100100
Update=100
DynamicWindowSize=1
OnRefreshAction=[!Move "1555" "75"]
[Metadata]
Name=NLAIWW Weather
Description=Detailed weather skin with up to N days forecast. Weather information is taken from http://www.weather.com.cn/Instructions=Look at the instructions below (at the NLAIWW Weather.ini file) for font colors, location, icons and units.
Version=1.1
Tags=Weather|NLAIWW
License=Creative Commons Attribution-Non-Commercial-Share Alike 3.0
Variant=
Preview=
#SKINSPATH#
VClouds Weather\Preview.png
[Variables]
FontFace=时尚中黑简体
FontColor=255,205,50,255
FontColor2=255,205,50,200
FontColor3=255,255,255,240
FontColor4=255,255,255,150
FontSize=9
FontSize2=12
;-- WEATHER ICONS -- folder Path for the weather icons and their size.
Icon=\IconC\
Icon2=\IconC\
;-- LOCATION -- Go to http://www.weather.com/ search for your city.
;when in your city page, Copy the 8 digit code at the URL in the address bar | Paste the location code below.
;--这里输入你的城市代码---
Location=101030100
LOC_URL=http://www.weather.com.cn/weather/#Location#.shtml
URL=http://www.weather.com.cn/weather/#Location#.shtml
;==========================================================
;[MEASURE WEATHER]=========================================
;==========================================================
[MeasureCurrent]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=1800
URL=http://www.weather.com.cn/weather/#Location#.shtml
RegExp="(?siU)<div class="ctop clearfix">.*<div class="crumbs fl">.*<a href=".*" target="_blank">(.*)</a>.*<span>>.*</span>.*<a href=".*" target="_blank">(.*)</a>.*<span>>.*.*<a href=".*">(.*)</a>.*<input type="hidden" id="hidden_title" value="(.*)" />.*<input type="hidden" id=".*" value=".*"/>.*<input type="hidden" id="update_time" value="(.*)"/>.*<big class="(.*)">.*</big>.*<big class="(.*)">.*</big>.*<p title="(.*)" class="wea">(.*)</p>.*<p class="tem">.*<i>(.*)</i>.*</p>.*<p class="win">.*<em>.*<span title="(.*)" class=".*">.*</span>.*</em>.*<i>(.*)</i>.*</p>.*</div>"
[MeasureCurrentday]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=1800
URL=http://www.weather.com.cn/weather1d/#Location#.shtml
RegExp="(?siU)<h1>(.*)</h1>.*<big class="(.*)"></big>.*<p class="wea" title="(.*)">(.*)</p>.*<p class="tem">.*<span>(.*)</span><em>(.*)</em>.*</p>.*<p class="win">.*<i class=".*"></i>.*<span class="" title="(.*)">(.*)</span>.*</p>.*<p class="sun sunUp"><i></i>.*<span>(.*)</span>.*</p>"
StringIndex=9
[MeasureCurrentnight]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=1800
URL=http://www.weather.com.cn/weather1d/#Location#.shtml
RegExp="(?siU)<h1>(.*)</h1>.*<big class="(.*)"></big>.*<p class="wea" title="(.*)">(.*)</p>.*<p class="tem">.*<span>(.*)</span><em>(.*)</em>.*</p>.*<p class="win">.*<i class=".*"></i>.*<span class="" title="(.*)">(.*)</span>.*</p>.*<p class="sun sunDown"><i></i>.*<span>(.*)</span>.*</p>"
StringIndex=2
[MeasureForcast7]
Measure=Plugin
Plugin=Plugins\WebParser.dll
URL=http://www.weather.com.cn/weather/#Location#.shtml#7d
RegExp="(?siU)<h1>(.*)</h1>.*<big class="(.*)"></big>.*<big class="(.*)"></big>.*<p title="(.*)" class="wea">.*</p>.*<p class="tem">.*<i>(.*)</i>(.*)</p>.*<p class="win">.*<em>.*<span title="(.*)" class=".*"></span>.*</em>.*<i>(.*)</i>.*</p>.*<h1>(.*)</h1>.*<big class="(.*)"></big>.*<big class="(.*)"></big>.*<p title="(.*)" class="wea">(.*)</p>.*<p class="tem">.*<span>(.*)</span>.*<i>(.*)</i>.*</p>.*<p class="win">.*<em>.*<span title="(.*)" class=".*"></span>.*<span title="(.*)" class=".*"></span>.*</em>.*<i>(.*)</i>.*</p>.*<h1>(.*)</h1>.*<big class="(.*)"></big>.*<big class="(.*)"></big>.*<p title="(.*)" class="wea">(.*)</p>.*<p class="tem">.*<span>(.*)</span>.*<i>(.*)</i>.*</p>.*<p class="win">.*<em>.*<span title="(.*)" class=".*"></span>.*<span title="(.*)" class=".*"></span>.*</em>.*<i>(.*)</i>.*</p>.*<h1>(.*)</h1>.*<big class="(.*)"></big>.*<big class="(.*)"></big>.*<p title="(.*)" class="wea">(.*)</p>.*<p class="tem">.*<span>(.*)</span>.*<i>(.*)</i>.*</p>.*<p class="win">.*<em>.*<span title="(.*)" class=".*"></span>.*<span title="(.*)" class=".*"></span>.*</em>.*<i>(.*)</i>.*</p>.*<h1>(.*)</h1>.*<big class="(.*)"></big>.*<big class="(.*)"></big>.*<p title="(.*)" class="wea">(.*)</p>.*<p class="tem">.*<span>(.*)</span>.*<i>(.*)</i>.*</p>.*<p class="win">.*<em>.*<span title="(.*)" class=".*"></span>.*<span title="(.*)" class=".*"></span>.*</em>.*<i>(.*)</i>.*</p>.*<h1>(.*)</h1>.*<big class="(.*)"></big>.*<big class="(.*)"></big>.*<p title="(.*)" class="wea">(.*)</p>.*<p class="tem">.*<span>(.*)</span>.*<i>(.*)</i>.*</p>.*<p class="win">.*<em>.*<span title="(.*)" class=".*"></span>.*<span title="(.*)" class=".*"></span>.*</em>.*<i>(.*)</i>.*</p>.*<h1>(.*)</h1>.*<big class="(.*)"></big>.*<big class="(.*)"></big>.*<p title="(.*)" class="wea">(.*)</p>.*<p class="tem">.*<span>(.*)</span>.*<i>(.*)</i>.*</p>.*<p class="win">.*<em>.*<span title="(.*)" class=".*"></span>.*<span title="(.*)" class=".*"></span>.*</em>.*<i>(.*)</i>.*</p>"
[MeasureForcast7_1]
Measure=Plugin
Plugin=Plugins\WebParser.dll
URL=http://www.weather.com.cn/weather/#Location#.shtml#7d
RegExp="(?siU)<h1>(.*)</h1>.*<big class="(.*)"></big>.*<big class="(.*)"></big>.*<p title="(.*)" class="wea">(.*)</p>.*<p class="tem">.*<span>(.*)</span>(.*)<i>(.*)</i>.*</p>.*<p class="win">.*<em>.*<span title="(.*)" class="(.*)"></span>.*<span title="(.*)" class="(.*)"></span>.*</em>.*<i>(.*)</i>.*</p>"
[MeasureForcastxxx]
Measure=Plugin
Plugin=Plugins\WebParser.dll
URL=http://www.weather.com.cn/weather/#Location#.shtmlRegExp="(?siU).*.*.*.*(.*).*(.*).*(.*).*.*.*.*(.*).*(.*).*(.*).*.*.*.*(.*).*(.*).*(.*).*.*.*.*(.*).*(.*).*(.*).*.*.*.*(.*).*(.*).*(.*).*.*.*.*.*.*(.*).*(.*).*.*.*"
;==========================================================
;[GRAPHICS]================================================
;==========================================================
;---Current---
;-=Icon=-
[MeasureIconCurrent]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[MeasureCurrentday]
StringIndex=2
Substitute="jpg80":"png40"
[MeasureIconCurrentN]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[MeasureCurrentnight]
StringIndex=2
Substitute="jpg80":"png40"
[IconCurrent]
Measure=Calc
Formula=MeasureIconCurrent
[ImageNumberCalc]
Measure=Calc
Formula=Counter % 84
Substitute=".SHADOW0":""
[MeterCurrentIcon]
MeasureName=MeasureIconCurrent
Meter=Image
PreserveAspectRatio=1
Path=
#Icon#

AntiAlias=1
X=280
Y=80
LeftMouseDownAction=!execute ["
#LOC_URL#
"]
[MeterCurrentIconN]
MeasureName=MeasureIconCurrentN
Meter=Image
PreserveAspectRatio=1
Path=
#Icon#

AntiAlias=1
X=280
Y=80
LeftMouseDownAction=!execute ["
#LOC_URL#
"]
[Measure24HrCurrent]
Measure=Time
Format=%#H
IfCondition=(Measure24Hr >= 18) && (Measure24Hr < 24)
IfTrueAction=[!HideMeter MeterCurrentIcon][!ShowMeter MeterCurrentIconN][!UpdateMeter *][!Redraw]
IfCondition2=(Measure24Hr >= 0) && (Measure24Hr < 6)
IfTrueAction2=[!HideMeter MeterCurrentIcon][!ShowMeter MeterCurrentIconN][!UpdateMeter *][!Redraw]
IfCondition3=(Measure24Hr >= 6) && (Measure24Hr < 18)
IfTrueAction3=[!HideMeter MeterCurrentIconN][!ShowMeter MeterCurrentIcon][!UpdateMeter *][!Redraw]
DynamicVariables=1
Disabled=#Today#
;-=Current=-
[MeasureTempCurrent]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[MeasureCurrentday]
StringIndex=5
[MeasureTempUniteCurrent]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[MeasureCurrentday]
StringIndex=6
[MeasureLocationCurrent]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[MeasureCurrent]
StringIndex=1
[MeasureLocationCity]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[MeasureCurrent]
StringIndex=2
[MeasureLocationC]
;Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[MeasureCurrentday]
StringIndex=
[MeasureUpdateCurrent]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[MeasureCurrent]
StringIndex=5
[MeasureConditionsCurrent]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[MeasureCurrentday]
StringIndex=3
[MeasurezwxCurrent]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[MeasureForcastxxx]
StringIndex=2
[MeasurezwxCurrent1]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[MeasureForcastxxx]
StringIndex=1
[MeasureWindDirCurrent]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[MeasureCurrentday]
StringIndex=7
[MeasureWindCurrent]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[MeasureCurrentday]
StringIndex=8
[MeasuregmzsCurrent]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[MeasureForcastxxx]
StringIndex=5
[MeasuregmzsCurrent1]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[MeasureForcastxxx]
StringIndex=4
[MeasurejtzsCurrent]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[MeasureForcastxxx]
StringIndex=14
[MeasurejtzsCurrent1]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[MeasureForcastxxx]
StringIndex=13
[MeasurePressure2Current]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[MeasureCurrent]
StringIndex=22
[MeasurePressure3Current]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[MeasureCurrent]
StringIndex=5
[MeasuressdCurrent]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[MeasureForcastxxx]
StringIndex=8
[MeasuressdCurrent1]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[MeasureForcastxxx]
StringIndex=7
[MeasurexczsCurrent]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[MeasureForcastxxx]
StringIndex=11
[MeasurexczsCurrent1]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[MeasureForcastxxx]
StringIndex=10
[MeasurekqwrkszsCurrent]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[MeasureForcastxxx]
StringIndex=16
[MeasurekqwrkszsCurrent1]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[MeasureForcastxxx]
StringIndex=17
[MeasureSunriseCurrent]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[MeasureCurrentday]
StringIndex=9
[MeasureSunsetCurrent]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[MeasureCurrentnight]
StringIndex=9
[MeterLocationCurrent]
MeasureName=MeasureLocationCurrent
Meter=String
X=-1
Y=120
FontColor=#FontColor#
FontFace=#FontFace#
FontSize=8
StringAlign=LEFT
StringStyle=NORMAL
StringEffect=SHADOW
AntiAlias=1
[MeterUpdateCurrent]
MeasureName=MeasureUpdateCurrent
Meter=String
X=60r
Y=120r
FontColor=#FontColor2#
FontFace=#FontFace#
FontSize=8
StringAlign=LEFT
StringStyle=NORMAL
StringEffect=SHADOW
FontEffectColor=00,0,0,180
AntiAlias=1
Text=""
[MeterTempCurrentH]
MeasureName=MeasureTempCurrent
MeasureName2=MeasureTempUniteCurrent
Meter=String
X=175
Y=65
FontColor=#FontColor3#
FontFace=#FontFace#
FontSize=23
StringAlign=LEFT
StringStyle=BOLD
StringEffect=BORDER
FontEffectColor=00,0,0,170
AntiAlias=1
Text="%1%2"
[MeterTempCurrentL]
;MeasureName=MeasureTempCurrentL
MeasureName2=MeasureTempUniteCurrent
;Meter=String
X=R
Y=25
FontColor=#FontColor3#
FontFace=#FontFace#
FontSize=20
StringAlign=LEFT
StringStyle=BOLD
StringEffect=BORDER
FontEffectColor=00,0,0,170
AntiAlias=1
Text="~%1"
[MeterConditionsCurrent]
MeasureName=MeasureConditionsCurrent
Meter=String
X=175
Y=108
FontColor=#FontColor3#
FontFace=#FontFace#
FontSize=16
StringStyle=BOLD
StringAlign=LEFT
StringEffect=BORDER
FontEffectColor=00,0,0,170
AntiAlias=1
[MeterzwxCurrent]
MeasureName=MeasurezwxCurrent
Meter=String
X=0
Y=82
FontFace=#FontFace#
FontColor=#FontColor3#
FontSize=7
StringAlign=LEFT
StringStyle=NORMAL
StringEffect=SHADOW
AntiAlias=1
Text=""
[MeterzwxCurrent1]
MeasureName=MeasurezwxCurrent1
Meter=String
X=60r
Y=0r
FontFace=#FontFace#
FontColor=#FontColor3#
FontSize=7
StringAlign=LEFT
StringStyle=NORMAL
StringEffect=SHADOW
AntiAlias=1
Text=""
[MetergmzsCurrent]
MeasureName=MeasuregmzsCurrent
Meter=String
X=0
Y=12r
FontFace=#FontFace#
FontColor=#FontColor3#
FontSize=7
StringAlign=LEFT
StringStyle=NORMAL
StringEffect=SHADOW
AntiAlias=1
[MetergmzsCurrent1]
MeasureName=MeasuregmzsCurrent1
Meter=String
X=50r
Y=0r
FontFace=#FontFace#
FontColor=#FontColor3#
FontSize=7
StringAlign=LEFT
StringStyle=NORMAL
StringEffect=SHADOW
AntiAlias=1
[MeterssdCurrent]
MeasureName=MeasuressdCurrent
Meter=String
X=0
Y=12r
FontFace=#FontFace#
FontColor=#FontColor3#
FontSize=7
StringAlign=LEFT
StringStyle=NORMAL
StringEffect=SHADOW
AntiAlias=1
[MeterssdCurrent1]
MeasureName=MeasuressdCurrent1
Meter=String
X=50r
Y=0r
FontFace=#FontFace#
FontColor=#FontColor3#
FontSize=7
StringAlign=LEFT
StringStyle=NORMAL
StringEffect=SHADOW
AntiAlias=1
[MeterxczsCurrent]
MeasureName=MeasurexczsCurrent
Meter=String
X=0
Y=12r
FontFace=#FontFace#
FontColor=#FontColor3#
FontSize=7
StringAlign=LEFT
StringStyle=NORMAL
StringEffect=SHADOW
AntiAlias=1
[MeterxczsCurren1]
MeasureName=MeasurexczsCurrent1
Meter=String
X=50r
Y=0r
FontFace=#FontFace#
FontColor=#FontColor3#
FontSize=7
StringAlign=LEFT
StringStyle=NORMAL
StringEffect=SHADOW
AntiAlias=1
[MeterWindDirCurrent]
MeasureName=MeasureWindDirCurrent
MeasureName2=MeasureWindCurrent
Meter=String
X=175
Y=145
FontFace=#FontFace#
FontColor=#FontColor3#
FontSize=12
StringAlign=LEFT
StringStyle=BOLD
StringEffect=SHADOW
AntiAlias=1
Text=" %1%2 "
[MeterPressureCurrent]
MeasureName=MeasurejtzsCurrent
Meter=String
X=0
Y=12r
FontFace=#FontFace#
FontColor=#FontColor3#
FontSize=7
StringAlign=LEFT
StringStyle=NORMAL
StringEffect=SHADOW
AntiAlias=1
[MeterPressureCurrent1]
MeasureName=MeasurejtzsCurrent1
Meter=String
X=50r
Y=0r
FontFace=#FontFace#
FontColor=#FontColor3#
FontSize=7
StringAlign=LEFT
StringStyle=NORMAL
StringEffect=SHADOW
AntiAlias=1
[MeterkqwekszsCurrent]
MeasureName=MeasurekqwrkszsCurrent
Meter=String
X=0
Y=12r
FontFace=#FontFace#
FontColor=#FontColor3#
FontSize=6
StringAlign=LEFT
StringStyle=NORMAL
StringEffect=SHADOW
AntiAlias=1
;[TODAY]=====================================
;-=Temperature=-
[MeasureTemp]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[MeasureForcast7]
StringIndex=5
[MeasureLow]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[MeasureForcast7_1]
StringIndex=6
[MeasureDOT]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[MeasureForcast7_1]
StringIndex=7
[MeterTempDay]
MeasureName2=MeasureDOT
MeasureName3=MeasureTemp
MeasureName=MeasureLow
Meter=String
X=215
Y=168
FontColor=#FontColor3#
FontFace=#FontFace#
FontSize=15
StringStyle=BOLD
AntiAlias=1
StringEffect=SHADOW
Text="%1 %2 %3"
[MeasureConditions]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[MeasureForcast7]
StringIndex=4
2020年02月12日 15点02分 1
level 1
MsJustvii 楼主
现在这个代码的皮肤总是时而消失,时而出现的,手动刷新一下,或者重加载一下就出来了,不过说不好啥时候自己就消失了
2020年02月12日 15点02分 2
level 1
MsJustvii 楼主
这个是我根据别人的代码,自己修改了一些符合自己的需求的。
总的目的只为达到图上这个效果和要素
大神高手们帮看一下为什么总是无故消失,需要刷新,还有就是代码有哪些是多余的,可以精简的!先行谢过!
2020年02月12日 15点02分 3
吧务
level 9
前来执法[滑稽],你要是懂雨滴问点在点上的问题还行,你把全部代码发上来也没人想看,问题是还得看懂才能知道怎么改
2020年02月12日 23点02分 5
最近天气插件用的最多的那个网站服务是不是停用了
2020年02月14日 15点02分
@丶一世长安丶 是滴,有一大批天气皮肤不能用了
2020年02月15日 01点02分
level 1
MsJustvii 楼主
自己顶一下
2020年02月13日 16点02分 6
level 1
最近我也在改天气,没接触过HTML代码还在琢磨,不过提取后几天预告的代码写太多了是肯定的,插件没用上
2020年02月14日 11点02分 7
嗯,是的,我也是从别人的代码里改过来的,只是显示了我需要的信息而已,后面的不太懂怎么删,就保留了,主要问题是前面应该1-2年都没出问题,挺好的,去年年底开始出现时有时无的状况,总要靠手动去刷新,想解决这个问题
2020年02月14日 16点02分
level 1
MsJustvii 楼主
手动靠前!
2020年02月18日 06点02分 8
level 1
MsJustvii 楼主
人工靠前!
2020年02月21日 06点02分 9
level 1
MsJustvii 楼主
靠前!
2020年02月25日 01点02分 10
1