我正在尝试构建一个Rainmeter小部件,它可以获取离用户最近的城镇并将其显示在屏幕上。我目前正在尝试使用webparser函数和this website,但似乎不起作用。我从Rainmeter网站上的例子中改编的代码如下--有什么想法吗?
[Rainmeter]
Author=Rainmeter staff
Update=1000
;[WEBSITE MEASURES]===============================
[MeasureWebsite]
Measure=Plugin
Plugin=WebParser
UpdateRate=1800
URL=http://locationdetection.mobi/
RegExp="(?siU)<span style="color:white;">town_city:</span> <b>"(.*)"</b>.*"
[MeasureTown]
Measure=Plugin
Plugin=WebParser
Url=[MeasureWebsite]
StringIndex=1
;[DISPLAY METERS]==================================
[TextStyle]
X=2
Y=17
FontFace=Segoe UI
FontSize=32
FontColor=#454442
StringStyle=Bold
Antialias=1
[MeterTown]
MeasureName=MeasureTown
Meter=String
MeterStyle=TextStyle
Y=2发布于 2014-06-13 21:47:27
我不确定是不是太晚了,但是...您的网址似乎不包含任何town_city信息...至少在源代码中没有。
Rainmeter从您提供的URL中读取原始的HTML代码,并通过提供的RegEx对其进行处理。如果网站中没有适当的信息,你就永远不能让它工作。
https://stackoverflow.com/questions/18726925
复制相似问题