What's new

data request - teams, nations, leagues

  • Thread starter josepk54
  • Start date
  • Views 1,082
J

josepk54

Enthusiast
Messages
289
Reaction score
63
Hello.

I'm doing something non-autobuyer related (i'm a good 18-months clean now and loving my spare time - I don't even have Fifa 15) and i'm looking for a nice structured set of teams names and the leagues and nations to which they belong. I propose procuring this information from the EA web app, so I was wondering if anyone can point me to a URL that probably exists containing this?

(Like http://cdn.content.easports.com/fif...-06A61A62EBC0/2015/fut/items/web/players.json for the players)

p.s. I did search the forum
 
Z

ZTM

Enthusiast
Messages
1,338
Reaction score
388
I think I posted those lists for Fifa 14, I can send you the updated ones tomorrow.
There are JSON files (like the players) and XML files (translations), but none of them seem to be completely right, so I matched them with market data.
 
Z

ZTM

Enthusiast
Messages
1,338
Reaction score
388
Teams: Nations: Leagues:
Welcome back :smile:
 
J

josepk54

Enthusiast
Messages
289
Reaction score
63
Thanks very much - this is exactly what I was looking for.

Although, I'm disappointed that I'll need to put in a little effort myself to identify which nations the leagues come from :tongue:
 
C

CPB

Enthusiast
Messages
202
Reaction score
16
If you can understand ColdFusion and still need it then this is what I use to import leagues and teams (assigning nations to the leagues)...

Code:
<!--- GET XML --->
<cfhttp url="https://www.easports.com/iframe/fut15/bundles/futweb/web/flash/xml/localization/messages.en_GB.xml?cl=144469" />
<cfset xmlContent = XmlParse(cfhttp.FileContent) />

<!--- INSERT TEAMS --->
<cfset xPath = "/xliff/file/body/trans-unit[starts-with(@resname, 'global.teamFull.2015.team')]" />
<cfset subSet = XmlSearch(xmlContent, xPath) />

<cfloop array="#subSet#" index="transUnit">   
   
    <cfset teamName = transUnit.xmlChildren[1].xmlText />
    <cfset teamID = Mid(ListLast(transUnit.XmlAttributes.resName, "."), 5, 15) />
       
    <cfquery name="insTeamRecord" datasource="FUT15">
        INSERT INTO FUT15Teams (teamID,teamName) VALUES (#teamID#,'#teamName#')
    </cfquery>
   
</cfloop>

<!--- GET TEAM ABBREVIATION --->
<cfset xPath = "/xliff/file/body/trans-unit[starts-with(@resname, 'global.teamabbr15.2015.team')]" />
<cfset subSet = XmlSearch(xmlContent, xPath) />

<cfloop array="#subSet#" index="transUnit">
   
    <cfset teamAbbrev = transUnit.xmlChildren[1].xmlText />
    <cfset teamID = Mid(ListLast(transUnit.XmlAttributes.resName, "."), 5, 15) />
       
    <cfquery name="updTeamRecord" datasource="FUT15">
        UPDATE FUT15Teams SET teamAbbreviation = '#teamAbbrev#' WHERE teamID = #teamID#
    </cfquery>

</cfloop>

<!--- INSERT LEAGUES --->
<cfset xPath = "/xliff/file/body/trans-unit[starts-with(@resname, 'global.leagueFull.2015.league')]" />
<cfset subSet = XmlSearch(xmlContent, xPath) />

<cfloop array="#subSet#" index="transUnit">   
   
    <cfset leagueName = transUnit.xmlChildren[1].xmlText />
    <cfset leagueID = Mid(ListLast(transUnit.XmlAttributes.resName, "."), 7, 15) />
       
    <cfquery name="insLeagueRecord" datasource="FUT15">
        INSERT INTO FUT15Leagues (leagueID,leagueName) VALUES (#leagueID#,'#leagueName#')
    </cfquery>
   
</cfloop>

<!--- GET LEAGUE ABBREVIATION --->
<cfset xPath = "/xliff/file/body/trans-unit[starts-with(@resname, 'global.leagueabbr15.2015.league')]" />
<cfset subSet = XmlSearch(xmlContent, xPath) />

<cfloop array="#subSet#" index="transUnit">
   
    <cfset leagueAbbrev = transUnit.xmlChildren[1].xmlText />
    <cfset leagueID = Mid(ListLast(transUnit.XmlAttributes.resName, "."), 7, 15) />
       
    <cfquery name="updLeagueRecord" datasource="FUT15">
        UPDATE FUT15Leagues SET leagueAbbreviation = '#leagueAbbrev#' WHERE leagueID = #leagueID#
    </cfquery>

</cfloop>

<!--- GET LEAGUE SHORT CODE --->
<cfset xPath = "/xliff/file/body/trans-unit[starts-with(@resname, 'global.leagueabbr5.2015.league')]" />
<cfset subSet = XmlSearch(xmlContent, xPath) />

<cfloop array="#subSet#" index="transUnit">
   
    <cfset leagueShortCode = transUnit.xmlChildren[1].xmlText />
    <cfset leagueID = Mid(ListLast(transUnit.XmlAttributes.resName, "."), 7, 15) />
       
    <cfquery name="updLeagueRecord" datasource="FUT15">
        UPDATE FUT15Leagues SET leagueShortCode = '#leagueShortCode#' WHERE leagueID = #leagueID#
    </cfquery>
   
</cfloop>

<!--- ASSIGN LEAGUES AND TEAMS --->
<cfhttp url="https://fifa15.content.easports.com/fifa/fltOnlineAssets/8D941B48-51BB-4B87-960A-06A61A62EBC0/2015/fut/config/web/teamconfig.json" method="GET" result="teamLeagueData">
    <cfhttpparam type="header" name="Accept" value="application/json" />
    <cfhttpparam type="header" name="Accept-Language" value="en-GB" />
    <cfhttpparam type="header" name="Cache-Control" value="keep-alive" />
    <cfhttpparam type="header" name="Content-Type" value="application/json" />
    <cfhttpparam type="header" name="User-Agent" value="Mozilla/5.0 (Windows NT 6.1; WOW64; rv:32.0) Gecko/20100101 Firefox/32.0" />
</cfhttp>

<cfset teamLeagueDataJSON = DeserializeJSON(teamLeagueData.FileContent) />

<cfloop from="1" to="#ArrayLen(teamLeagueDataJSON.Years)#" index="i">
   
    <cfif teamLeagueDataJSON.Years[i].Year EQ "2015">
       
        <!--- ASSIGN LEAGUE TO NATION --->
        <cfloop from="1" to="#ArrayLen(teamLeagueDataJSON.Years[i].Leagues)#" index="l">
       
            <cfset leagueID = teamLeagueDataJSON.Years[i].Leagues[l].LeagueId />
            <cfset nationID = teamLeagueDataJSON.Years[i].Leagues[l].NationId />
           
            <cfquery name="assignLeagueNation" datasource="FUT15">
                UPDATE FUT15Leagues SET nationID = #nationID# WHERE leagueID = #leagueID#
            </cfquery>
       
        </cfloop>
       
        <!--- ASSIGN TEAM TO LEAGUE --->
        <cfloop from="1" to="#ArrayLen(teamLeagueDataJSON.Years[i].Teams)#" index="t">
       
            <cfset teamID = teamLeagueDataJSON.Years[i].Teams[t].TeamId />
            <cfset leagueID = teamLeagueDataJSON.Years[i].Teams[t].LeagueId />
           
            <cfquery name="assignLeagueNation" datasource="FUT15">
                UPDATE FUT15Teams SET leagueID = #leagueID# WHERE teamID = #teamID#
            </cfquery>
       
        </cfloop>
   
    </cfif>
   
</cfloop>
 
Z

ZTM

Enthusiast
Messages
1,338
Reaction score
388
Only beware JSON and XML have different data and none of them is completely correct, I had to mix them and verify on the market.
 
Top Bottom