In my Life's Mission of trying to rationalise the Results from listCompetitions (particularly football) into some sort of usable Tree Menu I've got to the stage where I'm listing the various football competitions by competitionRegion, via a call to listCompetitions as below:
listCompetitions/{"filter":{"eventTypeIds":["1"],"marketCountries":["UA","SI","IS","GB","JP","KR","IE","NO","SE","FI", "B
R","SK","CH","RU","PL","CZ","DK","DE","RO","BG","A T","HU","BE","NL","FR","IT","TR","ES","CS","GR","P T","HR","KZ","IN","A
Z","AM","GE","IL","LV","LT","SA","CR","JM","VN","H K","JO","DZ","QA","EE","PE","AR","PY","ZA","CL","E C","MX","US","SG","T
H","AE","BY","IR","CO","CA","MK","UY","MV","KW","M Y","TT","CY","MD"]}}
I'm then sorting the competitions by country, so that I can make Menu Nodes for each country (by converting the 3 character competitionRegion into the "iso" full name) so that when a User clicks on the Country they'll get its associated Competitions.
That works fine BUT, I keep getting 'rogue' competitions, e.g. for UK ( "GBR" ) competitions I get:
GBR: {"competitionRegion":"GBR","marketCount":12,"compe tition":{"id":"20351","name":"NIFL Premiership"}}
GBR: {"competitionRegion":"GBR","marketCount":961,"comp etition":{"id":"31","name":"Barclays Premier League"}}
GBR: {"competitionRegion":"GBR","marketCount":942,"comp etition":{"id":"35","name":"League One"}}
GBR: {"competitionRegion":"GBR","marketCount":1478,"com petition":{"id":"33","name":"The Championship"}}
GBR: {"competitionRegion":"GBR","marketCount":124,"comp etition":{"id":"39","name":"Conference Premier"}}
GBR: {"competitionRegion":"GBR","marketCount":942,"comp etition":{"id":"37","name":"League Two"}}
GBR: {"competitionRegion":"GBR","marketCount":106,"comp etition":{"id":"843454","name":"Uruguayan Primera"}}
GBR: {"competitionRegion":"GBR","marketCount":38,"compe tition":{"id":"43","name":"Conference South"}}
GBR: {"competitionRegion":"GBR","marketCount":42,"compe tition":{"id":"41","name":"Conference North"}}
GBR: {"competitionRegion":"GBR","marketCount":36,"compe tition":{"id":"409743","name":"Scottish Cup"}}
GBR: {"competitionRegion":"GBR","marketCount":11,"compe tition":{"id":"111","name":"Scottish League Two"}}
GBR: {"competitionRegion":"GBR","marketCount":12,"compe tition":{"id":"109","name":"Scottish League One"}}
GBR: {"competitionRegion":"GBR","marketCount":61,"compe tition":{"id":"107","name":"Scottish Championship"}}
GBR: {"competitionRegion":"GBR","marketCount":313,"comp etition":{"id":"105","name":"Scottish Premiership"}}
GBR: {"competitionRegion":"GBR","marketCount":20,"compe tition":{"id":"822377","name":"Superliga Femenina"}}
GBR: {"competitionRegion":"GBR","marketCount":40,"compe tition":{"id":"3085778","name":"English Womens Super League"}}
GBR: {"competitionRegion":"GBR","marketCount":160,"comp etition":{"id":"860010","name":"Ukrainian Reserve League"}}
GBR: {"competitionRegion":"GBR","marketCount":30,"compe tition":{"id":"872215","name":"Ukrainian Persha Liga"}}
GBR: {"competitionRegion":"GBR","marketCount":37,"compe tition":{"id":"252549","name":"Welsh Premier League"}}
GBR: {"competitionRegion":"GBR","marketCount":3,"compet ition":{"id":"2608550","name":"Specials"}}
GBR: {"competitionRegion":"GBR","marketCount":29,"compe tition":{"id":"67646","name":"World Cup 2014 Qualifiers"}}
GBR: {"competitionRegion":"GBR","marketCount":1,"compet ition":{"id":"30558","name":"English FA Cup"}}
GBR: {"competitionRegion":"GBR","marketCount":1,"compet ition":{"id":"2134","name":"Capital One Cup"}}
GBR: {"competitionRegion":"GBR","marketCount":2,"compet ition":{"id":"986846","name":"Ramsdens Cup"}}
GBR: {"competitionRegion":"GBR","marketCount":107,"comp etition":{"id":"228","name":"UEFA Champions League"}}
GBR: {"competitionRegion":"GBR","marketCount":209,"comp etition":{"id":"2129602","name":"Professional Development League"
}}
now I've got no grudge against Uruguay, the Ukraine, or even the Superliga Femenina, but, as we say on ChitChat: WTF?
I should probably add that the list of marketCountries that are sent in the query:
listCompetitions/{"filter":{"eventTypeIds":["1"],"marketCountries":["UA","SI","IS","GB","JP","KR","IE","NO","SE","FI", "B
R","SK","CH","RU","PL","CZ","DK","DE","RO","BG","A T","HU","BE","NL","FR","IT","TR","ES","CS","GR","P T","HR","CO","KZ","I
N","AZ","AM","GE","IL","LV","LT","SA","CR","JM","V N","HK","JO","DZ","QA","EE","PE","AR","PY","ZA","C L","EC","MX","US","S
G","TH","AE","BY","IR","CA","MK","UY","MV","KW","M Y","TT","CY","MD"]}}
is derived from an earlier call to get the countries that have soccer competitions:
listCountries/{"filter":{"eventTypeIds":["1"]}}
and, as can be seen, the countryCode(s) returned by the listCountries request are 2 character iso codes. Quite confusing since listCompetitions returns 3 letter iso codes for competitionRegion !
listCompetitions/{"filter":{"eventTypeIds":["1"],"marketCountries":["UA","SI","IS","GB","JP","KR","IE","NO","SE","FI", "B
R","SK","CH","RU","PL","CZ","DK","DE","RO","BG","A T","HU","BE","NL","FR","IT","TR","ES","CS","GR","P T","HR","KZ","IN","A
Z","AM","GE","IL","LV","LT","SA","CR","JM","VN","H K","JO","DZ","QA","EE","PE","AR","PY","ZA","CL","E C","MX","US","SG","T
H","AE","BY","IR","CO","CA","MK","UY","MV","KW","M Y","TT","CY","MD"]}}
I'm then sorting the competitions by country, so that I can make Menu Nodes for each country (by converting the 3 character competitionRegion into the "iso" full name) so that when a User clicks on the Country they'll get its associated Competitions.
That works fine BUT, I keep getting 'rogue' competitions, e.g. for UK ( "GBR" ) competitions I get:
GBR: {"competitionRegion":"GBR","marketCount":12,"compe tition":{"id":"20351","name":"NIFL Premiership"}}
GBR: {"competitionRegion":"GBR","marketCount":961,"comp etition":{"id":"31","name":"Barclays Premier League"}}
GBR: {"competitionRegion":"GBR","marketCount":942,"comp etition":{"id":"35","name":"League One"}}
GBR: {"competitionRegion":"GBR","marketCount":1478,"com petition":{"id":"33","name":"The Championship"}}
GBR: {"competitionRegion":"GBR","marketCount":124,"comp etition":{"id":"39","name":"Conference Premier"}}
GBR: {"competitionRegion":"GBR","marketCount":942,"comp etition":{"id":"37","name":"League Two"}}
GBR: {"competitionRegion":"GBR","marketCount":106,"comp etition":{"id":"843454","name":"Uruguayan Primera"}}
GBR: {"competitionRegion":"GBR","marketCount":38,"compe tition":{"id":"43","name":"Conference South"}}
GBR: {"competitionRegion":"GBR","marketCount":42,"compe tition":{"id":"41","name":"Conference North"}}
GBR: {"competitionRegion":"GBR","marketCount":36,"compe tition":{"id":"409743","name":"Scottish Cup"}}
GBR: {"competitionRegion":"GBR","marketCount":11,"compe tition":{"id":"111","name":"Scottish League Two"}}
GBR: {"competitionRegion":"GBR","marketCount":12,"compe tition":{"id":"109","name":"Scottish League One"}}
GBR: {"competitionRegion":"GBR","marketCount":61,"compe tition":{"id":"107","name":"Scottish Championship"}}
GBR: {"competitionRegion":"GBR","marketCount":313,"comp etition":{"id":"105","name":"Scottish Premiership"}}
GBR: {"competitionRegion":"GBR","marketCount":20,"compe tition":{"id":"822377","name":"Superliga Femenina"}}
GBR: {"competitionRegion":"GBR","marketCount":40,"compe tition":{"id":"3085778","name":"English Womens Super League"}}
GBR: {"competitionRegion":"GBR","marketCount":160,"comp etition":{"id":"860010","name":"Ukrainian Reserve League"}}
GBR: {"competitionRegion":"GBR","marketCount":30,"compe tition":{"id":"872215","name":"Ukrainian Persha Liga"}}
GBR: {"competitionRegion":"GBR","marketCount":37,"compe tition":{"id":"252549","name":"Welsh Premier League"}}
GBR: {"competitionRegion":"GBR","marketCount":3,"compet ition":{"id":"2608550","name":"Specials"}}
GBR: {"competitionRegion":"GBR","marketCount":29,"compe tition":{"id":"67646","name":"World Cup 2014 Qualifiers"}}
GBR: {"competitionRegion":"GBR","marketCount":1,"compet ition":{"id":"30558","name":"English FA Cup"}}
GBR: {"competitionRegion":"GBR","marketCount":1,"compet ition":{"id":"2134","name":"Capital One Cup"}}
GBR: {"competitionRegion":"GBR","marketCount":2,"compet ition":{"id":"986846","name":"Ramsdens Cup"}}
GBR: {"competitionRegion":"GBR","marketCount":107,"comp etition":{"id":"228","name":"UEFA Champions League"}}
GBR: {"competitionRegion":"GBR","marketCount":209,"comp etition":{"id":"2129602","name":"Professional Development League"
}}
now I've got no grudge against Uruguay, the Ukraine, or even the Superliga Femenina, but, as we say on ChitChat: WTF?
I should probably add that the list of marketCountries that are sent in the query:
listCompetitions/{"filter":{"eventTypeIds":["1"],"marketCountries":["UA","SI","IS","GB","JP","KR","IE","NO","SE","FI", "B
R","SK","CH","RU","PL","CZ","DK","DE","RO","BG","A T","HU","BE","NL","FR","IT","TR","ES","CS","GR","P T","HR","CO","KZ","I
N","AZ","AM","GE","IL","LV","LT","SA","CR","JM","V N","HK","JO","DZ","QA","EE","PE","AR","PY","ZA","C L","EC","MX","US","S
G","TH","AE","BY","IR","CA","MK","UY","MV","KW","M Y","TT","CY","MD"]}}
is derived from an earlier call to get the countries that have soccer competitions:
listCountries/{"filter":{"eventTypeIds":["1"]}}
and, as can be seen, the countryCode(s) returned by the listCountries request are 2 character iso codes. Quite confusing since listCompetitions returns 3 letter iso codes for competitionRegion !



Comment