Azərbaycan dili Bahasa Indonesia Bosanski Català Čeština Dansk Deutsch Eesti English Español Français Galego Hrvatski Italiano Latviešu Lietuvių Magyar Malti Mакедонски Nederlands Norsk Polski Português Português BR Românã Slovenčina Srpski Suomi Svenska Tiếng Việt Türkçe Ελληνικά Български Русский Українська Հայերեն ქართული ენა 中文
Subpage under development, new version coming soon!

Subject: Decode timePlayed from xml

  • 1
  • 2
2022-08-15 21:45:07
sky81 to All
Hello,
Does anyone know how can I find out from the match xml how many minutes a player has played? There is a field called "timePlayed" but I do not know how to decoded.
2022-08-15 21:52:32
You can see it on the match report.
or detailed on the individual marks
All numbers are left outlined in this order:

mark - time - shots - fouls

So the number, if any, that is shown between the mark (match rating) and shots is the time the player played.
Normally you can see how many minutes the player played on the training page as well. Only both league games are cumulated, so if you need to know, you must check before wednesdays match.

Or are you talking about sokker organizer?
2022-08-15 22:11:13
he is talkin about xml service exposed for external apps but there is no such field unfortunatly
2022-08-15 22:11:30
For SO I did not find any info inside de xml, but on sokker viewer I saw that there is an match.xml file which has a field called "timePlayed". The value of that field I want to decode .
2022-08-15 22:12:44
actully im worng https://sokker.org/xml/match-39390379.xml
2022-08-15 22:12:59
He talks about XML interface

Yeah, it's a bit tricky because you need to know the shirt number to be sure whether the player played or not. This is how I do it, reading matches-team-[TeamID].xml:

int number = new Integer(((DomText) nodoJugador.getFirstByXPath("number/text()")).asText());
int timeIn = new Integer(((DomText) nodoJugador.getFirstByXPath("timeIn/text()")).asText());
int timeOut = new Integer(((DomText) nodoJugador.getFirstByXPath("timeOut/text()")).asText());

if (number <= 11 || timeIn > 0) {
int total_time = (int) (timeIn > 90 ? 0f : ((timeOut == 0 || timeOut > 90 ? 90 : timeOut) - (timeIn == 0 ? 0 : timeIn - 1)));
}
(edited)
2022-08-15 22:14:49
+1 yep time in and time out calculates if player played as sub or full time
2022-08-15 22:15:57
Problem with shirt number is that there's no guarantee the player always play with the same number...
(edited)
2022-08-15 22:19:32
its double-check number and player id ...
2022-08-15 22:20:16
<playerStats>
<playerID>37738895</playerID>
<number>10</number>
<formation>3</formation>
<timeIn>0</timeIn>
<timeOut>67</timeOut>
<yellowCards>0</yellowCards>
<redCards>0</redCards>
<isInjured>0</isInjured>
<goals>1</goals>
<assists>0</assists>
<fouls>0</fouls>
<shoots>1</shoots>
<rating>68</rating>
<timePlaying>808</timePlaying>
<timeDefending>627</timeDefending>
</playerStats>
<playerStats>
<playerID>37819871</playerID>
<number>10</number>
<formation>3</formation>
<timeIn>67</timeIn>
<timeOut>0</timeOut>
<yellowCards>0</yellowCards>
<redCards>0</redCards>
<isInjured>0</isInjured>
<goals>0</goals>
<assists>0</assists>
<fouls>1</fouls>
<shoots>1</shoots>
<rating>61</rating>
<timePlaying>444</timePlaying>
<timeDefending>556</timeDefending>
</playerStats>
2022-08-15 22:21:08
Hmm ... the field is called "timePlaying" and for example I played the gk in 2 league matches for 90 min in each match. timePlayingh has value 4282 in 1st match and 4800 in 2nd match. What is the formula which give me 90?
2022-08-15 22:23:22
Ah so its timeIn and timeOut fields not timePlaying field, right?
2022-08-15 22:24:27
from what i saw the defult played time is 90 if player has value in timeOut you remove that time if player has timeIn is same 90 - playerTime Out
if has both is timeOut - timeIn not sure how you have those values can you send me id of game
2022-08-15 22:25:00
yes
2022-08-15 22:25:29
timePlaying is some offensive stats as far i understand
2022-08-15 22:25:50
<timePlaying>2435</timePlaying>
<timeDefending>632</timeDefending>
  • 1
  • 2