Page 2 of 2

Re: NHL.com player ID field

Posted: Tue Jun 28, 2016 10:01 am
by Almember
Est-ce que quelqu'un aurait le CSV à importer pour le NHL ID ?

Merci

Re: NHL.com player ID field

Posted: Tue Jun 28, 2016 10:31 am
by SimonT
Salut.

Regarde le téléchargement Rating 2016, j'ai mis un fichier CSV dedans.

Re: NHL.com player ID field

Posted: Tue Jul 12, 2016 3:23 pm
by gresh
Ce serait bien aussi d'avoir le champs NHLID pour les prospects.

Re: NHL.com player ID field

Posted: Sun Jul 17, 2016 10:19 am
by JimToupet
Does this field can be filled with the rating pack ?

Re: NHL.com player ID field

Posted: Sun Jul 17, 2016 10:30 am
by SimonT
JimToupet wrote:Does this field can be filled with the rating pack ?
Sadly no. You have import it with Bonus Command.

Re: NHL.com player ID field

Posted: Sat Aug 26, 2017 2:50 pm
by SimonT
For your information, NHL website has change there website so the script has change. Here is the new one :

Code: Select all

$JSON = Invoke-RestMethod -uri "https://statsapi.web.nhl.com/api/v1/teams?expand=team.roster&season=20172018&site=en_nhl"
$Team = $JSON.teams
ForEach($TeamData in $Team){
    $TeamAbre = $TeamData.abbreviation
    Write-host $TeamAbre -BackgroundColor Green
    ForEach($Person in $TeamData.roster.roster.person){        
        $Person | Add-Member -MemberType NoteProperty -Name Team -Value $TeamAbre
        $Person | Export-csv "NHLData.csv" -Append -NoTypeInformation -Force
    }
}