It is currently April 30th, 2024, 11:29 pm

A RSS feed problem

Get help with creating, editing & fixing problems with skins
ArticdemoN
Posts: 2
Joined: April 18th, 2012, 10:13 pm

A RSS feed problem

Post by ArticdemoN »

Hello everyone!

I have done every tutorial and make a few skins so far, one of which already uses WebParser without any problem.
But today i tried to create another meter and I can't manage to display the information i want.

Here is my work so far.
[Rainmeter]
Author=ArticdemoN
Update=1000

[Variables]
FontColor=255,255,255,255
FontFace=Andes
URL="http://hordes.feuerfrei.fr/game/315773"
Codeville=(315773)


------------------Measures----------------

[MeasureWebsite]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=1800
Url=#URL#
RegExp="(?siU)<title>Feed my Hordes - (.*)#Codeville#</title>.*Population :(.*)</li>.*
[<imgsrc="http://data.hordes.fr/gfx/icons/small_well.gif"/>(.*)].*Défense :(.*)= [<img
src=.*<li>Jour(.*)</li>
Debug=1

[MeasureTitre]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[MeasureWebsite]
StringIndex=1

[MeasurePop]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[MeasureWebsite]
StringIndex=2

[MeasurePuit]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[MeasureWebsite]
StringIndex=3


[MeasureDef]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[MeasureWebsite]
StringIndex=4

[Measureatt]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[MeasureWebsite]
StringIndex=5

--------------Meters-------------

[MeterTitre]
MeasureName=MeasureTitre
Meter=STRING
X=0
Y=0
FontColor=#Fontcolor#
FontSize=12
StringAlign=LEFT
FontFace=#FontFace#
Antialias=1
Text="%1"

[MeterPop]
MeasureName=MeasurePop
Meter=STRING
X=r
Y=R
FontColor=#Fontcolor#
FontSize=12
StringAlign=LEFT
FontFace=#FontFace#
Antialias=1
Text="Population: %1"


[MeterPuit]
MeasureName=Measurepuit
Meter=STRING
X=r
Y=R
FontColor=#Fontcolor#
FontSize=12
StringAlign=LEFT
FontFace=#FontFace#
Antialias=1
Text="Puit: %1"

[MeterDef]
MeasureName=Measuredef
Meter=STRING
X=r
Y=R
FontColor=#Fontcolor#
FontSize=12
StringAlign=LEFT
FontFace=#FontFace#
Antialias=1
Text="Nos defences:%1"

[Meterattaque]
MeasureName=Measureatt
Meter=STRING
X=r
Y=R
FontColor=#Fontcolor#
FontSize=12
StringAlign=LEFT
FontFace=#FontFace#
Antialias=1
Text="Estimation pour le jour %1"
The web page i want to retrieve information from: http://hordes.feuerfrei.fr/game/315773

The information I want to display is the title, the population, the number after the well gif, the one after "defences" and the "Jour x : [min = x] - [max = x] "

Someone knows why it don't appear? I think my Regexp doesn't work but i can't figure out where...
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: A RSS feed problem

Post by jsmorley »

Based on what I can figure out from your description and my complete lack of French, I think you want:

RegExp="(?siU)<title>Feed my Hordes - (.*) \(.*small_human.gif.*Population : (.*)</li>.*small_well.gif.* (.*)\D.*/item_plate.gif.*Défense : (.*) .*<li>Jour (.*) :.*min = (.*)\D.*max = (.*)\D"

Returns this:

Code: Select all

01=> Vide angoissant
02=> 12/40
03=> 20
04=> 201
05=> 6
06=> 160
07=> 230
One thing to be very careful of is that your RegExp= line is contained in quotes and is all on ONE line in the .ini file.

I recommend you take a look at using RainRegExp as it can really help with getting those regular expressions right. Just put in the URL at the top, connect to it, and start building your RegExp= statement at the bottom, one step at a time. Hit "Parse" after each step, so you are sure what you have up until then is working. Then just keep adding until you have everything you want.
ArticdemoN
Posts: 2
Joined: April 18th, 2012, 10:13 pm

Re: A RSS feed problem

Post by ArticdemoN »

That was exactly what I needed, thank you very much!
I will take a look at RainRegexp too :D