NHL.com player ID field

Your suggestions are always welcome. / Vos suggestions sont toujours bienvenues.
Almember
New in Town / Le Ptit Nouveau
Posts: 28
Joined: Fri Nov 25, 2011 10:36 am

Re: NHL.com player ID field

Post by Almember »

Est-ce que quelqu'un aurait le CSV à importer pour le NHL ID ?

Merci
SimonT
STHS Owner / Propriétaire du STHS
Posts: 14755
Joined: Sat Oct 08, 2005 4:18 pm
Location: Montreal, Canada
Contact:

Re: NHL.com player ID field

Post by SimonT »

Salut.

Regarde le téléchargement Rating 2016, j'ai mis un fichier CSV dedans.
-SimonT
Forum Administrator / Administrateur du Forum
STHS Owner / Propriètaire du STHS
English V2 & V3 Manual - Manuel V2 & V3 Français
gresh
The Passion One / Le Passionné
Posts: 202
Joined: Mon Aug 22, 2011 9:27 am
Contact:

Re: NHL.com player ID field

Post by gresh »

Ce serait bien aussi d'avoir le champs NHLID pour les prospects.
JimToupet
STHS Dynamic Website Contributor
Posts: 363
Joined: Wed Jul 02, 2014 10:55 am

Re: NHL.com player ID field

Post by JimToupet »

Does this field can be filled with the rating pack ?
SimonT
STHS Owner / Propriétaire du STHS
Posts: 14755
Joined: Sat Oct 08, 2005 4:18 pm
Location: Montreal, Canada
Contact:

Re: NHL.com player ID field

Post by SimonT »

JimToupet wrote:Does this field can be filled with the rating pack ?
Sadly no. You have import it with Bonus Command.
-SimonT
Forum Administrator / Administrateur du Forum
STHS Owner / Propriètaire du STHS
English V2 & V3 Manual - Manuel V2 & V3 Français
SimonT
STHS Owner / Propriétaire du STHS
Posts: 14755
Joined: Sat Oct 08, 2005 4:18 pm
Location: Montreal, Canada
Contact:

Re: NHL.com player ID field

Post 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
    }
}

-SimonT
Forum Administrator / Administrateur du Forum
STHS Owner / Propriètaire du STHS
English V2 & V3 Manual - Manuel V2 & V3 Français
Post Reply