It is currently May 2nd, 2024, 12:57 pm

Assistance with stock exchange web parser

Get help with creating, editing & fixing problems with skins
5000DOC5000
Posts: 2
Joined: June 30th, 2011, 9:49 pm

Assistance with stock exchange web parser

Post by 5000DOC5000 »

Hi all.... I just discovered rainmeter and can`t just get home to play with it, trying to get hold of it. I am only a regular PC user, so I must say I feel like walking on the moon.

I am Spanish and i was looking for a skin for the Madrid Ibex 35 stock exchange. Couldn't find any, so I thought I would give it a try..... reproducing some othe skin.... but of course unsuccessfully. I would appreciate any help for this very simple skin. I have enough ambition to improve it later on though. This is only to get me started.

the webpage I amm trying to get the info from is http://www.bolsamadrid.es/esp/contenido.asp?enlace=mercados/acciones/accind1_1.htm and I only want the very basic information on the little frame in the middle.

Cheers.

Code: Select all

;[BEGIN CONFIG FILE]==============================

[Rainmeter]
Author= DOC5000
Update=1000

[Variables]
URL="http://www.bolsamadrid.es/esp/contenido.asp?enlace=mercados/acciones/accind1_1.htm"
FontColor=255, 255, 255, 255
FontFace=arial
Substitute="&":"&",""":"","&Quot;":"","<br>":"","![CDATA[":"","]]":"","...":"","<":"",">":"","/PRE>":"","PRE>":"","<":""

;[WEBSITE MEASURES]===============================

[MeasureWebsite]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=1800
Url=#URL#
RegExp="(?siU)<h3>Anterior to locate:<input type="text" name="Anterior" size="15" value="(.*)">.*ro-no_bots_pls12" value="(.*)" size="20".*ro-no_bots_pls13" value="(.*)" size="20".*ro-no_bots_pls14" value="(.*)" size="20".*ro-no_bots_pls15" value="(.*)" size="20".*ro-no_bots_pls16" value="(.*)" size="20".*ro-no_bots_pls17" value="(.*)" size="20".*ro-no_bots_pls10" value="(.*)" size="20".*ro-no_bots_pls19" value="(.*)" size="20".*ro-no_bots_pls9" value="(.*)" size="20".*ro-no_bots_pls4" value="(.*)" size="20""

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

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

[MeasureDif.(%)]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[MeasureWebsite]
StringIndex=3

[MeasureMáximo]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[MeasureWebsite]
StringIndex=4

[MeasureMínimo]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[MeasureWebsite]
StringIndex=5

;[DISPLAY METERS]==================================

[MeterBackground]
Meter=IMAGE
X=1
Y=1
H=89
W=250
SolidColor=0,0,0,255

[MeterAnterior]
MeasureName=MeasureAnterior
Meter=STRING
X=2
Y=2
FontColor=#FontColor#
FontSize=12
StringAlign=LEFT
FontFace=#FontFace#
Antialias=1
Prefix="ANTERIOR: "

[MeterÚltimo]
MeasureName=MeasureÚltimo
Meter=STRING
X=2
Y=17r
FontColor=#FontColor#
FontSize=12
StringAlign=LEFT
FontFace=#FontFace#
Antialias=1
Prefix="ÚLTIMO: "

[MeterDif.(%)]
MeasureName=MeasureDif.(%)
Meter=STRING
X=2
Y=17r
FontColor=#FontColor#
FontSize=12
StringAlign=LEFT
FontFace=#FontFace#
Antialias=1
Prefix="DIFERENCIAL: "

[MeterMáximo]
MeasureName=MeasureMáximo
Meter=STRING
X=2
Y=17r
FontColor=#FontColor#
FontSize=12
StringAlign=LEFT
FontFace=#FontFace#
Antialias=1
Prefix="MÁXIMO: "

[MeterMínimo]
MeasureName=MeasureMínimo
Meter=STRING
X=2
Y=17r
FontColor=#FontColor#
FontSize=12
StringAlign=LEFT
FontFace=#FontFace#
Antialias=1
Prefix="MÍNIMO: "
Last edited by GhostMatrix on July 1st, 2011, 11:36 am, edited 1 time in total.
Reason: Fix post colour tag, add code tag for the config file
User avatar
GhostMatrix
Rainmeter Sage
Posts: 141
Joined: April 18th, 2009, 8:26 pm
Location: Montreal, Quebec, Canada 45.5658°N, 73.5898°W UTC -5

Re: Assistance with stock exchange web parser

Post by GhostMatrix »

Your Url is wrong!

Use this one http://www.bolsamadrid.es/esp/mercados/acciones/accind1_1.htm

Code: Select all

http://www.bolsamadrid.es/esp/mercados/acciones/accind1_1.htm
and this

RegExp="(?siU)<TR><TD align=center ID=Tit>(.*)<BR>.*<TR align=right ID=G><TD align=left><IMG SRC="/images/(.*).gif" BORDER=0>\s(.*)</TD><TD>(.*)</TD><TD>(.*)</TD><TD ID=(.*)>(.*)</TD><TD>(.*)</TD><TD>(.*)</TD></TR>.*</TABLE></td></tr></table><BR>"

It will return...

StringIndex=1 Jueves, 30 de Junio de 2011 (17:37)
StringIndex=2 arr-up9
StringIndex=3 IBEX 35®
StringIndex=4 10.143,60
StringIndex=5 10.359,90
StringIndex=6 V
StringIndex=7 2,13
StringIndex=8 10.359,90
StringIndex=9 10.191,80

The Index 2 return the name of the little arrow image
The Index 6 return I think the text colour of the Dif. (%) V=green and a different letter for red

Note that you can also put a StringIndex= on the main measure [MeasureWebsite]


GM
If at first you don't succeed; call it version 0.1

Image
5000DOC5000
Posts: 2
Joined: June 30th, 2011, 9:49 pm

Re: Assistance with stock exchange web parser

Post by 5000DOC5000 »

Cheers, thxs. Now I have the data retrieved, I'll work on the skin.
User avatar
Mordasius
Posts: 1173
Joined: January 22nd, 2011, 4:23 pm
Location: GMT +8

Re: Assistance with stock exchange web parser

Post by Mordasius »

5000DOC5000 wrote:... I am Spanish and i was looking for a skin for the Madrid Ibex 35 stock exchange. Couldn't find any, so I thought I would give it a try.....
If you haven't managed to get it working properly you can go to another post on the forum and download the MarketIndices skin http://rainmeter.net/forum/viewtopic.php?t=8809&p=54352#p54352

Go to the [Variables] section and make the following changes

Code: Select all

; Index/Stock Labels
Number2=IBEX 35

; Quote URLs
Quote2=http://finance.yahoo.com/q?s=^IBEX&ql
That should get information from Yahoo Finance and you can click on the IBEX 35 label to be taken to the correct page for further details.
.