It is currently July 12th, 2020, 4:15 pm

Football (soccer...) skin

Help with creating, editing & fixing problems with skins
dvo
Posts: 818
Joined: February 7th, 2016, 6:08 am

Re: Football (soccer...) skin

Post by dvo »

it works here shows liverpool 29 27 1 1 66 21 +45 82 over here in black :D

grabbed it from https://pastebin.com/Z42emaVU // pastebin
User avatar
balala
Rainmeter Sage
Posts: 11013
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Football (soccer...) skin

Post by balala »

dvo wrote:
May 24th, 2020, 7:30 am
it works here shows liverpool 29 27 1 1 66 21 +45 82 over here in black :D

grabbed it from https://pastebin.com/Z42emaVU // pastebin
Well, it shows nothing here. Checked second time and nothing. :(
But let's wait for tom0711's reply and see what he says.
tom0711
Posts: 36
Joined: April 29th, 2020, 5:55 pm

Re: Football (soccer...) skin

Post by tom0711 »

The Code works
You do not have the required permissions to view the files attached to this post.
User avatar
balala
Rainmeter Sage
Posts: 11013
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Football (soccer...) skin

Post by balala »

dvo wrote:
May 24th, 2020, 7:30 am
it works here shows liverpool 29 27 1 1 66 21 +45 82 over here in black :D
tom0711 wrote:
May 24th, 2020, 10:00 am
The Code works
Yep, indeed it does work, was just my inattention. I had black fonts on a completely black background I have on the desktop, so I didn't see what was shown. So yes, it is working. Is it ok tom0711?
tom0711
Posts: 36
Joined: April 29th, 2020, 5:55 pm

Re: Football (soccer...) skin

Post by tom0711 »

It’s ok,but again, need more info(all the teams,fixtures and results)
User avatar
balala
Rainmeter Sage
Posts: 11013
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Football (soccer...) skin

Post by balala »

tom0711 wrote:
May 24th, 2020, 12:11 pm
It’s ok,but again, need more info(all the teams,fixtures and results)
Alright, here it is:

Code: Select all

[Rainmeter]
Update=1000

[Variables]
Item=tablebodyContainer.*span class="long">(.*)</span.*<t.*>(.*)</.*<t.*>(.*)</.*<t.*>(.*)</.*<t.*>(.*)</.*<t.*>(.*)</.*<t.*>(.*)</.*<t.*>..........(.*)</.*<t.*>(.*)</

[StringStyle]
FontSize=21
FontColor=0,0,0
AntiAlias=1
W=130
H=60
ClipString=1
Text=%1

[Team1]
Measure=WebParser
URL=https://www.premierleague.com/tables
RegExp=(?siU)#Item#.*#Item#.*#Item#.*#Item#.*#Item#
StringIndex=1

[Played1]
Measure=WebParser
URL=[Team1]
StringIndex=2

[Won1]
Measure=WebParser
URL=[Team1]
StringIndex=3

[Drawn1]
Measure=WebParser
URL=[Team1]
StringIndex=4

[Lost1]
Measure=WebParser
URL=[Team1]
StringIndex=5

[GF1]
Measure=WebParser
URL=[Team1]
StringIndex=6

[GA1]
Measure=WebParser
URL=[Team1]
StringIndex=7

[GD1]
Measure=WebParser
URL=[Team1]
StringIndex=8

[Points1]
Measure=WebParser
URL=[Team1]
StringIndex=9

[Team2]
Measure=WebParser
URL=[Team1]
StringIndex=10

[Played2]
Measure=WebParser
URL=[Team1]
StringIndex=11

[Won2]
Measure=WebParser
URL=[Team1]
StringIndex=12

[Drawn2]
Measure=WebParser
URL=[Team1]
StringIndex=13

[Lost2]
Measure=WebParser
URL=[Team1]
StringIndex=14

[GF2]
Measure=WebParser
URL=[Team1]
StringIndex=15

[GA2]
Measure=WebParser
URL=[Team1]
StringIndex=16

[GD2]
Measure=WebParser
URL=[Team1]
StringIndex=17

[Points2]
Measure=WebParser
URL=[Team1]
StringIndex=18

[Team3]
Measure=WebParser
URL=[Team1]
StringIndex=19

[Played3]
Measure=WebParser
URL=[Team1]
StringIndex=20

[Won3]
Measure=WebParser
URL=[Team1]
StringIndex=21

[Drawn3]
Measure=WebParser
URL=[Team1]
StringIndex=22

[Lost3]
Measure=WebParser
URL=[Team1]
StringIndex=23

[GF3]
Measure=WebParser
URL=[Team1]
StringIndex=24

[GA3]
Measure=WebParser
URL=[Team1]
StringIndex=25

[GD3]
Measure=WebParser
URL=[Team1]
StringIndex=26

[Points3]
Measure=WebParser
URL=[Team1]
StringIndex=27

[Team4]
Measure=WebParser
URL=[Team1]
StringIndex=28

[Played4]
Measure=WebParser
URL=[Team1]
StringIndex=29

[Won4]
Measure=WebParser
URL=[Team1]
StringIndex=30

[Drawn4]
Measure=WebParser
URL=[Team1]
StringIndex=31

[Lost4]
Measure=WebParser
URL=[Team1]
StringIndex=32

[GF4]
Measure=WebParser
URL=[Team1]
StringIndex=33

[GA4]
Measure=WebParser
URL=[Team1]
StringIndex=34

[GD4]
Measure=WebParser
URL=[Team1]
StringIndex=35

[Points4]
Measure=WebParser
URL=[Team1]
StringIndex=36

[Team5]
Measure=WebParser
URL=[Team1]
StringIndex=37

[Played5]
Measure=WebParser
URL=[Team1]
StringIndex=38

[Won5]
Measure=WebParser
URL=[Team1]
StringIndex=39

[Drawn5]
Measure=WebParser
URL=[Team1]
StringIndex=40

[Lost5]
Measure=WebParser
URL=[Team1]
StringIndex=41

[GF5]
Measure=WebParser
URL=[Team1]
StringIndex=42

[GA5]
Measure=WebParser
URL=[Team1]
StringIndex=43

[GD5]
Measure=WebParser
URL=[Team1]
StringIndex=44

[Points5]
Measure=WebParser
URL=[Team1]
StringIndex=45

; = = = = = METERS = = = = =

[TextTeam1]
Meter=String
MeterStyle=StringStyle
MeasureName=Team1
X=0
Y=0

[TextPlayed1]
Meter=String
MeterStyle=StringStyle
MeasureName=Played1
X=140
Y=0r

[TextWon1]
Meter=String
MeterStyle=StringStyle
MeasureName=Won1
X=180
Y=0r

[TextDrawn1]
Meter=String
MeterStyle=StringStyle
MeasureName=Drawn1
X=220
Y=0r

[TextLost1]
Meter=String
MeterStyle=StringStyle
MeasureName=Lost1
X=260
Y=0r

[TextGF1]
Meter=String
MeterStyle=StringStyle
MeasureName=GF1
X=300
Y=0r

[TextGA1]
Meter=String
MeterStyle=StringStyle
MeasureName=GA1
X=340
Y=0r

[TextGD1]
Meter=String
MeterStyle=StringStyle
MeasureName=GD1
X=380
Y=0r

[TextPoints1]
Meter=String
MeterStyle=StringStyle
MeasureName=Points1
X=450
Y=0r

[TextTeam2]
Meter=String
MeterStyle=StringStyle
MeasureName=Team2
X=0
Y=0R

[TextPlayed2]
Meter=String
MeterStyle=StringStyle
MeasureName=Played2
X=140
Y=0r

[TextWon2]
Meter=String
MeterStyle=StringStyle
MeasureName=Won2
X=180
Y=0r

[TextDrawn2]
Meter=String
MeterStyle=StringStyle
MeasureName=Drawn2
X=220
Y=0r

[TextLost2]
Meter=String
MeterStyle=StringStyle
MeasureName=Lost2
X=260
Y=0r

[TextGF2]
Meter=String
MeterStyle=StringStyle
MeasureName=GF2
X=300
Y=0r

[TextGA2]
Meter=String
MeterStyle=StringStyle
MeasureName=GA2
X=340
Y=0r

[TextGD2]
Meter=String
MeterStyle=StringStyle
MeasureName=GD2
X=380
Y=0r

[TextPoints2]
Meter=String
MeterStyle=StringStyle
MeasureName=Points2
X=450
Y=0r

[TextTeam3]
Meter=String
MeterStyle=StringStyle
MeasureName=Team3
X=0
Y=0R

[TextPlayed3]
Meter=String
MeterStyle=StringStyle
MeasureName=Played3
X=140
Y=0r

[TextWon3]
Meter=String
MeterStyle=StringStyle
MeasureName=Won3
X=180
Y=0r

[TextDrawn3]
Meter=String
MeterStyle=StringStyle
MeasureName=Drawn3
X=220
Y=0r

[TextLost3]
Meter=String
MeterStyle=StringStyle
MeasureName=Lost3
X=260
Y=0r

[TextGF3]
Meter=String
MeterStyle=StringStyle
MeasureName=GF3
X=300
Y=0r

[TextGA3]
Meter=String
MeterStyle=StringStyle
MeasureName=GA3
X=340
Y=0r

[TextGD3]
Meter=String
MeterStyle=StringStyle
MeasureName=GD3
X=380
Y=0r

[TextPoints3]
Meter=String
MeterStyle=StringStyle
MeasureName=Points3
X=450
Y=0r

[TextTeam4]
Meter=String
MeterStyle=StringStyle
MeasureName=Team4
X=0
Y=0R

[TextPlayed4]
Meter=String
MeterStyle=StringStyle
MeasureName=Played4
X=140
Y=0r

[TextWon4]
Meter=String
MeterStyle=StringStyle
MeasureName=Won4
X=180
Y=0r

[TextDrawn4]
Meter=String
MeterStyle=StringStyle
MeasureName=Drawn4
X=220
Y=0r

[TextLost4]
Meter=String
MeterStyle=StringStyle
MeasureName=Lost4
X=260
Y=0r

[TextGF4]
Meter=String
MeterStyle=StringStyle
MeasureName=GF4
X=300
Y=0r

[TextGA4]
Meter=String
MeterStyle=StringStyle
MeasureName=GA4
X=340
Y=0r

[TextGD4]
Meter=String
MeterStyle=StringStyle
MeasureName=GD4
X=380
Y=0r

[TextPoints4]
Meter=String
MeterStyle=StringStyle
MeasureName=Points4
X=450
Y=0r

[TextTeam5]
Meter=String
MeterStyle=StringStyle
MeasureName=Team5
X=0
Y=0R

[TextPlayed5]
Meter=String
MeterStyle=StringStyle
MeasureName=Played5
X=140
Y=0r

[TextWon5]
Meter=String
MeterStyle=StringStyle
MeasureName=Won5
X=180
Y=0r

[TextDrawn5]
Meter=String
MeterStyle=StringStyle
MeasureName=Drawn5
X=220
Y=0r

[TextLost5]
Meter=String
MeterStyle=StringStyle
MeasureName=Lost5
X=260
Y=0r

[TextGF5]
Meter=String
MeterStyle=StringStyle
MeasureName=GF5
X=300
Y=0r

[TextGA5]
Meter=String
MeterStyle=StringStyle
MeasureName=GA5
X=340
Y=0r

[TextGD5]
Meter=String
MeterStyle=StringStyle
MeasureName=GD5
X=380
Y=0r

[TextPoints5]
Meter=String
MeterStyle=StringStyle
MeasureName=Points5
X=450
Y=0r
I'd modify the options of the String meters (now all common options are collected into the [StringStyle] section and this section is applied on all String meters), but this is just a design question and it can be done easily.
tom0711
Posts: 36
Joined: April 29th, 2020, 5:55 pm

Re: Football (soccer...) skin

Post by tom0711 »

i dont wanna be rude, but thats it?
You do not have the required permissions to view the files attached to this post.
dvo
Posts: 818
Joined: February 7th, 2016, 6:08 am

Re: Football (soccer...) skin

Post by dvo »

it's a lot of code to get every digit to show ... after building it all ...you have to check all and after that you can make it a bit nicer ....
and yess it's a lot of work ...
User avatar
balala
Rainmeter Sage
Posts: 11013
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Football (soccer...) skin

Post by balala »

tom0711 wrote:
May 24th, 2020, 9:53 pm
i dont wanna be rude, but thats it?
Exactly, that's it. Is there something wrong with it? As said in my last reply, I also would improve the design of he skin, but basically it does work.
User avatar
Yincognito
Posts: 1917
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Football (soccer...) skin

Post by Yincognito »

balala wrote:
May 19th, 2020, 6:41 pm
I'm not sure it can be done, especially that there are a lot of information. Note that a WebParser measure can get up to 99 data from the site. And if the number of entries varies (what i suppose), we should have to use Lookahead Assertion. All these complicates the code a little bit.
But let's see...
It can be done, it has nothing to do with the 99 captures possible in regex, since one can split the data into multiple regexes, it doesn't have to be a single parent. For example, by using StringIndex and StringIndex2 in the WebParser children measures.
tom0711 wrote:
May 24th, 2020, 12:11 pm
It’s ok,but again, need more info(all the teams,fixtures and results)
tom0711 wrote:
May 24th, 2020, 9:53 pm
i dont wanna be rude, but thats it?
See, Tom, the thing is, it's easy to need something, but it's harder to get what you need, LOL. For that, if you rely only on others, you'll end up empty handed, because nobody is willing to to all the heavy lifting for you, that's a fact of life. Balala was nice enough to give you a start, and if you really want to make this skin work, it's mostly up to you to continue what Balala started.

I know, I know: you don't know how to do it, otherwise you'd have done it already, right? Well, all of us started "not knowing" how to do stuff, but we were stubborn enough to persevere and in the end managed to do things. The good thing is that you can get all the PL tables and results at Premier League - Tables, but as far as I can see you can't get the PL fixtures (maybe another source would come handy with that).

So, to start familiarizing with what you have to do, you should:
- view the page source of the webpage above in your browser
- select all and copy it
- find a HTML formatter service online (e.g. Free Formatter), paste it there and format it in a new window
- select all and copy again
- assuming you have Notepad++ (maybe even RainLexer plugin?), paste it and set the "Language" to HTML from the menu
- find the bits / parts that you need and try to guess the structure in the HTML in order to be able to "locate" every occurence of those bits so you can display them later in the skin
- build a regex to parse the page source; yes, this is the hard part, but mostly you'll use the (?siU) flags at the start of the regex, and then .* (i.e. any character any number of times) to discard what you don't need, and when you get to the parts that you need use what you got from the HTML structure (i.e. tags, separators, quotes, etc.) to set the "bounds" of what you want to capture. You capture using the same .* pattern, but enclosed in round brackets, like this: (.*). For example, say you want to get the team name from this part:

Code: Select all

                              <tr class="expandable" data-filtered-table-row-expander="18">
                                 <td colspan="13">
                                    <a href="/clubs/18/Sheffield-United/overview" class="expandableTeam">
                                    <span class="badge badge-image-container" data-widget="club-badge-image" data-size="50">
                                    <img class="badge-image badge-image--50" src="https://resources.premierleague.com/premierleague/badges/50/t49.png" srcset="https://resources.premierleague.com/premierleague/badges/50/t49@x2.png 2x" />
                                    </span>
                                    <span class="teamName">Sheffield United</span>
                                    </a>
then you'd use something like (?siU).*<span class="teamName">(.*)</span>.* (notice the span structure that we used to grab some closeby contents)
- use that regex in your code, typically in a RegExp option from a WebParser measure.

Now this is just how things can be done, a modus operandi if you like. It seems hard, but it's not that hard, in the end. You can test your regex as you like on sites like I linked to (regex101.com is another), even using the same text and the same pattern. If it works in the test, it should work in your skin as well.

That being said, you can ask anytime for help if you try and stumble a bit, but in principle this should be your job to do, once you know the way it should be approached. Today I'm not in the mood for this, but maybe tomorrow I will take a look at how the page source can be parsed. I don't promise anything, and I won't do it all for you, but I may be able to help with the regex part.