I'm currently in the process of making my first ever skin from scratch. The skin shows the previous and next game for any football/soccer team of your choosing. The data for this comes from a website called BeSoccer and, for the sake of testing, I'm using my favorite team, Manchester United.
As you can see, each fixture on the team page shows the name of the competition that match is contested in but not the logo. So, I'm looking for a way to use WebParser to use the name of the competition to retrieve its logo. At the moment I have got it working by having the logos downloaded locally for the competitions where Man. United are involved. However, as I am looking to have this skin work for almost any team in world football, it would be ridiculous to include around 1200 logos (for all the competitions available on the site) in the .rmskin package.
So my plan is to create a .txt file that contains all the competition names along with a link to their logos. Then, the competition name can be collected from the site using WebParser and then another WebParser will search the .txt for that competition and return the link to its logo which can then be downloaded in another measure.
Here is the code I'm testing on:
Code: Select all
[Rainmeter]
Update=1000
AccurateText=1
DynamicWindowSize=1
[MeasureSite]
Measure=WebParser
URL=https://www.besoccer.com/team/matches/manchester-united-fc
RegExp=(?siU)<div class="panel-title">Upcoming Matches</div>.*<div class="middle-info ta-c">(.*)</div>
[MeasureCompetition]
Measure=WebParser
URL=[MeasureSite]
StringIndex=1
[MeasureText]
Measure=WebParser
URL=file://#CURRENTPATH#Test.txt
RegExp=(?siU)[MeasureCompetition]: (.*)\r
DynamicVariables=1
[MeasureLogoLink]
Measure=WebParser
URL=[MeasureText]
StringIndex=1
Download=1
[MeterLogo]
Meter=Image
MeasureName=MeasureLogoLink
H=120
DynamicVariables=1
Code: Select all
La Liga: https://cdn.resfu.com/img_data/competiciones/logo/1.png
Premier League: https://cdn.resfu.com/img_data/competiciones/logo/10.png
Edit: Forgot to mention, I tried to do it using variables, and it worked when I had assigned a static string value to the variable. But when I tried assigning the value of the measure to the variable, it stopped working.