It is currently April 28th, 2024, 6:39 pm

Webparser and Measures

Get help with creating, editing & fixing problems with skins
desin
Posts: 5
Joined: August 4th, 2012, 8:27 pm

Webparser and Measures

Post by desin »

Code: Select all

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

[MeasureImage1]
Measure=Plugin
Plugin=WebParser
Url=http://edge1.mobafire.com/images/champion/icon/[Measure1Link].png
Download=1
The MeasureImage1 doesn't do anything when there is [Measure1Link] instead of some actual text. Measure1Link returns text which I want to be in the link to download the image. Debug doesn't show anything and i've seen this site and which gave me nothing. WHAT AM I DOING WRONG? :confused:

And one more thing. Is there any way for Measure1Link which returns "Alistar" to return "alistar" in lower case? I know the StringCase thing but it only works in Meters.
User avatar
haibusa2005
Posts: 52
Joined: June 15th, 2011, 7:23 pm
Location: Bulgaria, Varna

Re: Webparser and Measures

Post by haibusa2005 »

You must use a RegExp to fetch the exact address of the image. The exact link can be accessed via a measure of the type

[GetImage]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=SomeUrl.com
RegExp="some regexp"
StringIndex=01
Download=1

This will give you the exact address of the image and will download it locally. The it can be accessed within a Image measure meter.

[DisplayImage]
Meter=Image
MeasureName=GetImage
x=0
y=0
and so on.

Check these links to get more information about regular expressions, web parser and related stuff. You might also give a try of JSMorley's great tool - RainRegExp

http://rainmeter.net/cms/Plugins-WebParser_beta
http://www.pcre.org/
http://rainmeter.net/cms/Tips-WebParserPrimer
http://www.regular-expressions.info/tutorial.html
desin
Posts: 5
Joined: August 4th, 2012, 8:27 pm

Re: Webparser and Measures

Post by desin »

thanks, that helped.


I need some help with another problem.

Let's say [Measure1], in which i used webparser, is returning a word "Test" which first letter is uppercase.
And I need to use Measure1 value in another Measure2 and the value has to be lowercased.

Is there any way to change case of [Measure1] value so that it would return "test" instead of "Test"?
User avatar
Kaelri
Developer
Posts: 1721
Joined: July 25th, 2009, 4:47 am

Re: Webparser and Measures

Post by Kaelri »

You could do it by brute force with a substitute on [Measure1]:

Code: Select all

Substitute="A":"a","B":"b","C":"c"...
There may be a way to use RegExpSubstitute to do it more cleanly, but I'm not familiar enough to say for sure.

It's also very easy to do in Lua:

Code: Select all

NewString = string.lower(OldString)
desin
Posts: 5
Joined: August 4th, 2012, 8:27 pm

Re: Webparser and Measures

Post by desin »

Thanks for help!

But once again I have a problem :D

How can I join two strings into one in Lua? e.g. I have one string http://www.somewebsite.com/ and the other one as index.php, and I need a third joined string http://www.somewebsite.com/index.php
Or do the same with Measure values.

but i need them to join without spaces

EDIT: FOUND OUT ABOUT THE .. double dot option!!!!! everythings working out now
Last edited by desin on August 5th, 2012, 8:20 pm, edited 1 time in total.
User avatar
Kaelri
Developer
Posts: 1721
Joined: July 25th, 2009, 4:47 am

Re: Webparser and Measures

Post by Kaelri »

Code: Select all

JoinedString = String1..String2
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Webparser and Measures

Post by jsmorley »

desin wrote:Thanks for help!

But once again I have a problem :D

How can I join two strings into one in Lua? e.g. I have one string http://www.somewebsite.com/ and the other one as index.php, and I need a third joined string http://www.somewebsite.com/index.php
Or do the same with Measure values.

but i need them to join without spaces
the ".." pattern is used to concatenate strings or string variables.

finalString = 'http://www.somewebsite.com'..'index.php'
finalString = stringOne..stringTwo