- UID
- 121848
- 主题
- 注册时间
- 2011-5-22
- 在线时间
- 小时
- 最后登录
- 1970-1-1
签到天数: 208 天 [LV.7]常住居民III
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?点击注册
x
本帖最后由 pyrogas 于 2013-7-1 01:07 编辑
以自己的illustro皮肤为例 (link:http://bbs.rainmeter.cn/thread-55131-1-1.html )
另外一款Companion套装同样是用这个代码的
这个皮肤的特点就是可以根据时间自动切换白天和夜晚模式,图标和温度都会切换。图标切换是必然的,至于温度,国内的天气网站会在夜晚把白天的最高温删除,如果不作出调整,那么插件预报的明日气温其实是,今日最低温和明日最高温,以此类推后天的气温也不准切了。很多天气皮肤都存在这个问题,所以自己写了一个。2013/6/30更新,重写。
- [Rainmeter]
- Author=Papa
- e-mail:[email protected]
- Update=1000
- [Variables]
- WeatherCodeLocation=101210101
- WeatherUnit=m
- Day=[!ShowmeterGroup Day][!HideMeterGroup Night] \\\\ 依旧定义白天隐藏什么组,夜晚显示什么组
- Night=[!HidemeterGroup Day][!ShowMeterGroup Night]
- [TXT]
- Fontface=微软雅黑 \\\\\\\\\\\\\定义字体、大小、颜色,可以直接引用减少代码行
- FontColor=255,255,255,180
- FontSize=7
- StringAlign=RIGHT
- StringStyle=BOLD
- Antialias=1
- ;==================================================BG
- [meterBackground] \\\\\\\\\\\\\\\\设置背景
- Meter=IMAGE \\\\\\\\\\\\\\\\\\Meter为图片
- ImageName=BackgroundAnalog.png \\\\\\\\\\\\\\图片地址
- X=0
- Y=0
- ;=========================================================Weather RSS
- [MeasureWeatherRSS]
- Measure=Plugin
- Plugin=Plugins\WebParser.dll
- UpdateRate=600
- URL=http://m.weather.com.cn/data//#WeatherCodeLocation#.html
- cc=*&unit=#WeatherUnit#&dayf=6
- RegExp="{"weatherinfo":{"city":"(.*)","city_en":"(.*)","date_y":"(.*)","date":"(.*)","week":"(.*)","fchh":"(.*)","cityid":"(.*)","temp1":"(.*)℃~(.*)℃","temp2":"(.*)℃~(.*)℃","temp3":"(.*)℃~(.*)℃","temp4":"(.*)℃~(.*)℃","temp5":"(.*)℃~(.*)℃","temp6":"(.*)~(.*)","tempF1":"(.*)","tempF2":"(.*)","tempF3":"(.*)","tempF4":"(.*)","tempF5":"(.*)","tempF6":"(.*)","weather1":"(.*)","weather2":"(.*)","weather3":"(.*)","weather4":"(.*)","weather5":"(.*)","weather6":"(.*)","img1":"(.*)","img2":"(.*)","img3":"(.*)","img4":"(.*)","img5":"(.*)","img6":"(.*)","img7":"(.*)","img8":"(.*)","img9":"(.*)","img10":"(.*)","img11":"(.*)","img12":"(.*)","img_single":"(.*)","img_title1":"(.*)","img_title2":"(.*)","img_title3":"(.*)","img_title4":"(.*)","img_title5":"(.*)","img_title6":"(.*)","img_title7":"(.*)","img_title8":"(.*)","img_title9":"(.*)","img_title10":"(.*)","img_title11":"(.*)","img_title12":"(.*)","img_title_single":"(.*)","wind1":"(.*)","wind2":"(.*)","wind3":"(.*)","wind4":"(.*)","wind5":"(.*)","wind6":"(.*)","fx1":"(.*)","fx2":"(.*)","fl1":"(.*)","fl2":"(.*)","fl3":"(.*)","fl4":"(.*)","fl5":"(.*)","fl6":"(.*)","index":"(.*)","index_d":"(.*)","index48":"(.*)","index48_d":"(.*)","index_uv":"(.*)","index48_uv":"(.*)","index_xc":"(.*)","index_tr":"(.*)","index_co":"(.*)","st1":"(.*)","st2":"(.*)","st3":"(.*)","st4":"(.*)","st5":"(.*)","st6":"(.*)","index_cl":"(.*)","index_ls":"(.*)"}}" \\\\\\\\\\设定取值格式
- ;=====================================================Now Temp
- [MeasureWeatherNOW]
- Measure=Plugin
- Plugin=Plugins\WebParser.dll
- UpdateRate=1800
- Url=http://www.weather.com.cn/data/sk//#WeatherCodeLocation#.html
- RegExp="{"weatherinfo":{"city":"(.*)","cityid":"(.*)","temp":"(.*)","WD":"(.*)","WS":"(.*)","SD":"(.*)","WSE":"(.*)","time":"(.*)","isRadar":"(.*)","Radar":"(.*)"}}"
- StringIndex=1
- ;=================================================Now
- [MeasureWeatherTemp]
- Measure=Plugin
- Plugin=Plugins\WebParser.dll
- Url=[MeasureWeatherNOW]
- StringIndex=3 \\\\\\\\\\\\\\\\\取格式中第3个 (.*)代替的数值。
- [MeasureWeatherDesc]
- Measure=Plugin
- Plugin=Plugins\WebParser.dll
- Url=[MeasureWeatherRSS]
- StringIndex=26 \\\\\\\\\\\\\\\\\取格式中第26个 (.*)代替的数值。
- [MeasureWeatherIcon]
- Measure=Plugin
- Plugin=Plugins\WebParser.dll
- Url=[MeasureWeatherRSS]
- StringIndex=32
- ;==================================================Now Day
- [MeterIconD] \\\\ 白天天气图标
- Group=Day \\\\\\\\对不同内容进行分组
- MeasureName=MeasureWeatherIcon \\\\\\\\\\\\\\\\\\\获取[MeasureWeatherIcon]数值
- Meter=IMAGE
- Path=#CurrentPATH#/Day/ \\\\\\\\\\\\\\\\\\\\\\输出Day文件夹下的天气图标
- X=15
- Y=13
- W=40
- H=40
- [MeterIconN]
- Group=Night
- MeasureName=MeasureWeatherIcon
- Meter=IMAGE
- Path=#CurrentPATH#/Night/
- X=15
- Y=13
- W=40
- H=40
- [MeterTemp]
- MeasureName=MeasureWeatherTemp
- Meter=STRING
- X=200
- Y=10
- FontColor=255,255,255,205
- FontSize=12
- StringAlign=RIGHT
- StringStyle=BOLD
- FontFace=微软雅黑
- Antialias=1
- Postfix="°"
- [MeterDesc]
- MeasureName=MeasureWeatherDesc
- Meter=STRING
- X=100
- Y=14
- W=100
- FontColor=255,255,255,205
- FontSize=8
- StringAlign=RIGHT
- StringStyle=BOLD
- FontFace=微软雅黑
- Antialias=1
- ;=================================================Temp
- --------------------------------Day
- [MeasureWeatherTempD1]
- Measure=Plugin
- Plugin=Plugins\WebParser.dll
- Url=[MeasureWeatherRSS]
- StringIndex=8
- [MeasureWeatherTempD2]
- Measure=Plugin
- Plugin=Plugins\WebParser.dll
- Url=[MeasureWeatherRSS]
- StringIndex=9
- [MeasureWeatherTempD3]
- Measure=Plugin
- Plugin=Plugins\WebParser.dll
- Url=[MeasureWeatherRSS]
- StringIndex=10
- [MeasureWeatherTempD4]
- Measure=Plugin
- Plugin=Plugins\WebParser.dll
- Url=[MeasureWeatherRSS]
- StringIndex=11
- [MeasureWeatherTempD5]
- Measure=Plugin
- Plugin=Plugins\WebParser.dll
- Url=[MeasureWeatherRSS]
- StringIndex=12
- [MeasureWeatherTempD6]
- Measure=Plugin
- Plugin=Plugins\WebParser.dll
- Url=[MeasureWeatherRSS]
- StringIndex=13
- ;--------------------------------Night
- [MeasureWeatherTempN1]
- Measure=Plugin
- Plugin=Plugins\WebParser.dll
- Url=[MeasureWeatherRSS]
- StringIndex=9
- [MeasureWeatherTempN2]
- Measure=Plugin
- Plugin=Plugins\WebParser.dll
- Url=[MeasureWeatherRSS]
- StringIndex=10
- [MeasureWeatherTempN3]
- Measure=Plugin
- Plugin=Plugins\WebParser.dll
- Url=[MeasureWeatherRSS]
- StringIndex=11
- [MeasureWeatherTempN4]
- Measure=Plugin
- Plugin=Plugins\WebParser.dll
- Url=[MeasureWeatherRSS]
- StringIndex=12
- [MeasureWeatherTempN5]
- Measure=Plugin
- Plugin=Plugins\WebParser.dll
- Url=[MeasureWeatherRSS]
- StringIndex=13
- [MeasureWeatherTempN6]
- Measure=Plugin
- Plugin=Plugins\WebParser.dll
- Url=[MeasureWeatherRSS]
- StringIndex=14
- ;================================================Icons
- 这里需要说明一下,在Weather D&N中有这样一段代码:Substitute="99":[MeasureWeatherIconN1] 因为在网页数据中,99代表晚上天气图标与白天天气图标相同,所以需要把夜晚时候的99替换为白天数据。
- [MeasureWeatherIcon1]
- Measure=Plugin
- Plugin=Plugins\WebParser.dll
- Url=[MeasureWeatherRSS]
- StringIndex=32
- ;-------------------------
- [MeasureWeatherIcon2]
- Measure=Plugin
- Plugin=Plugins\WebParser.dll
- Url=[MeasureWeatherRSS]
- StringIndex=34
- ;-------------------------
- [MeasureWeatherIcon3]
- Measure=Plugin
- Plugin=Plugins\WebParser.dll
- Url=[MeasureWeatherRSS]
- StringIndex=36
- ;==================================================================ICON
- [MeterIconD1]
- Group=Day
- MeasureName=MeasureWeatherIcon1
- Meter=IMAGE
- Path=#CurrentPATH#/Day/
- X=70
- Y=37
- H=20
- W=20
- [MeterIconD2]
- Group=Day
- MeasureName=MeasureWeatherIcon2
- Meter=IMAGE
- Path=#CurrentPATH#/Day/
- X=25R
- Y=37
- H=20
- W=20
- [MeterIconD3]
- Group=Day
- MeasureName=MeasureWeatherIcon3
- Meter=IMAGE
- Path=#CurrentPATH#/Day/
- X=25R
- Y=37
- H=20
- W=20
- --------------------------------------
- [MeterIconN1]
- Group=Night
- MeasureName=MeasureWeatherIcon1
- Meter=IMAGE
- Path=#CurrentPATH#/Night/
- X=70
- Y=37
- H=20
- W=20
- [MeterIconN2]
- Group=Night
- MeasureName=MeasureWeatherIcon2
- Meter=IMAGE
- Path=#CurrentPATH#/Night/
- X=25R
- Y=37
- H=20
- W=20
- [MeterIconN3]
- Group=Night
- MeasureName=MeasureWeatherIcon3
- Meter=IMAGE
- Path=#CurrentPATH#/Night/
- X=25R
- Y=37
- H=20
- W=20
- ;==============================================DayTemp
- [MeterTempD1]
- Group=Day
- MeasureName=MeasureWeatherTempD1
- Meter=STRING
- MeterStyle=TXT
- X=115
- Y=35
- Postfix="°"
- [MeterTempD2]
- Group=Day
- MeasureName=MeasureWeatherTempD2
- Meter=STRING
- MeterStyle=TXT
- X=115
- Y=-2R
- Postfix="°"
- [MeterTempD3]
- Group=Day
- MeasureName=MeasureWeatherTempD3
- Meter=STRING
- MeterStyle=TXT
- X=157
- Y=35
- Postfix="°"
- [MeterTempD4]
- Group=Day
- MeasureName=MeasureWeatherTempD4
- Meter=STRING
- MeterStyle=TXT
- X=157
- Y=-2R
- Postfix="°"
- [MeterTempD5]
- Group=Day
- MeasureName=MeasureWeatherTempD5
- Meter=STRING
- MeterStyle=TXT
- X=199
- Y=35
- Postfix="°"
- [MeterTempD6]
- Group=Day
- MeasureName=MeasureWeatherTempD6
- Meter=STRING
- MeterStyle=TXT
- X=199
- Y=-2R
- Postfix="°"
- ;==============================================NightTemp
- [MeterTempN1]
- Group=Night
- MeasureName=MeasureWeatherTempN1
- Meter=STRING
- MeterStyle=TXT
- X=115
- Y=35
- Postfix="°"
- [MeterTempN2]
- Group=Night
- MeasureName=MeasureWeatherTempN2
- Meter=STRING
- MeterStyle=TXT
- X=115
- Y=-2R
- Postfix="°"
- [MeterTempN3]
- Group=Night
- MeasureName=MeasureWeatherTempN3
- Meter=STRING
- MeterStyle=TXT
- X=157
- Y=35
- Postfix="°"
- [MeterTempN4]
- Group=Night
- MeasureName=MeasureWeatherTempN4
- Meter=STRING
- MeterStyle=TXT
- X=157
- Y=-2R
- Postfix="°"
- [MeterTempN5]
- Group=Night
- MeasureName=MeasureWeatherTempN5
- Meter=STRING
- MeterStyle=TXT
- X=199
- Y=35
- Postfix="°"
- [MeterTempN6]
- Group=Night
- MeasureName=MeasureWeatherTempN6
- Meter=STRING
- MeterStyle=TXT
- X=199
- Y=-2R
- Postfix="°"
- ;=============================================Shift
- [MeasureH]
- Measure=Time
- Format=%H
- [DayOrNight]
- Measure=Calc
- DynamicVariables=1
- Formula=[MeasureH]>5 ? ([MeasureH]<18 ? 0 : 1 ) : 1 \\\\\\\\\ 判断当前时间是否在 5~18之间,是输出0,否输出1
- [MeasureTime0] \\\\\\\\\\\\\\当SUNORNIGHT=1时显示Night组
- Measure=Calc
- Formula=DayOrNight
- IfEqualValue=1
- IfEqualAction=!execute #Night#[!RainmeterRedraw]
- [MeasureTime1] \\\\\\\\\\\\\\当SUNORNIGHT=0时显示Day组
- Measure=Calc
- Formula=DayOrNight
- IfEqualValue=0
- IfEqualAction=!execute #Day#[!RainmeterRedraw]
复制代码 |
评分
-
查看全部评分
|