NHL.com + Sochi 2014 Data URLs in JSON and JSONP

Discussion in 'By The Numbers' started by Step7750, Feb 1, 2014.

View Users: View Users
  1. Step7750

    Step7750 Registered User

    Joined:
    Jan 24, 2014
    Messages:
    55
    Likes Received:
    1
    Trophy Points:
    0
    Location:
    Calgary, Alberta
    After going through the network traffic of NHL's services, I have compiled a list of URLs that the NHL uses to obtain stats for certain players, teams, standings, etc... Best of all, all of this data is free and does not require any sort of API Key or anything of that nature.

    This data came from the network traffic of NHL.com on a PC, NHL Gamecenter App on an iPhone, and TSN's iPhone App. There is no HTML/Web scraping involved :)


    To make the data more readable, please use www.jsonlint.com to parse it.

    JSON/JSONP Data > HTML Scraping

    All URLs are subject to change but based upon the previous URLs, the NHL will post the new URL when you call the old one


    Team Roster:​


    http://nhlwc.cdnak.neulion.com/fs1/nhl/league/teamroster/ANA/iphone/clubroster.json

    Change the team name (ex. ANA) to the wanted team; returns most current roster

    Team Schedule Per Month

    http://nhlwc.cdnak.neulion.com/fs1/nhl/league/clubschedule/CGY/2014/02/iphone/clubschedule.json

    Change CGY to the wanted team abbreviation, 2014 to the wanted year and 02 to the wanted month.

    Player Stats for the Entire Specified Team:​


    ex. http://nhlwc.cdnak.neulion.com/fs1/...ne/20132014/2/ANA/iphone/playerstatsline.json

    From the Gamecenter App - Simple Structure, change the season and team as wanted

    Playoff Player Stats for the Entire Specified Team:​


    http://nhlwc.cdnak.neulion.com/fs1/...ne/20132014/3/PIT/iphone/playerstatsline.json

    Simple Structure, change the season and team as wanted, the 3 stands for Playoffs

    Stats for an Individual Player:​


    You can either loop through the club roster and "player stats line" URL's above or get it from TSN:

    http://www.tsn.ca/mobile/bbcard.aspx?hub=NHL&name=Sidney+Crosby

    XML Data!

    Just change the player name as desired.

    Stats for Games:​


    There are a couple of URL's for this data, the most common that NHL.com uses are:

    Structure: "http://live.nhle.com/GameData/" + Year (ex 20132014) + "/" + Gameid (ex 2013020821) + "/gc/" + Data Wanted (gcsb, gcbx etc...) + ".jsonp"


    http://live.nhle.com/GameData/20132014/2013020821/gc/gcsb.jsonp

    - Updates way quicker than the data for the specified day (http://live.nhle.com/GameData/GCScor...13-01-31.jsonp) and contains Team ID's, Player's currently on the ice (gives their jersey numbers), Shots and goals for each team separated by the total or by period, current game time (in seconds in the sr listing), most recent event/play.


    http://live.nhle.com/GameData/20132014/2013020758/gc/gcbx.jsonp

    - Recommended for in depth recent in-game plays and player stats. Contains recent events (it does not contain all of the events!), goal summary (goal scorer, assists, time, id, teams involved, type of play (you can find the alphabetical equivalents that correspond to the numbers on a script the NHL has which will be discussed below), penalty summary, and the only way to obtain the game stats for each player in the game according to their jersey number (the NHL.com Player ID is not necessary).

    - For each player it includes their Assists, Goals, PIM, Plus Minus, Shots, and Time On Ice for that game


    PlayByPlay.jsonp is not used by the NHL.com at this current time but contains all of the plays of the game, and goal info; I don't know whether NHL.com will continue to update it in the future.

    "League Leaders" Overview Stats

    http://nhlwc.cdnak.neulion.com/fs1/nhl/league/leagueleaders/iphone/leagueleaders.json

    "League Leaders" In Points

    http://nhlwc.cdnak.neulion.com/fs1/nhl/league/leagueleaders/iphone/points/leagueleaders.json

    "League Leaders" In Goals

    http://nhlwc.cdnak.neulion.com/fs1/nhl/league/leagueleaders/iphone/goals/leagueleaders.json

    "League Leaders" In Assists

    http://nhlwc.cdnak.neulion.com/fs1/nhl/league/leagueleaders/iphone/assists/leagueleaders.json

    "League Leaders" In Plus/Minus

    http://nhlwc.cdnak.neulion.com/fs1/nhl/league/leagueleaders/iphone/plusminus/leagueleaders.json

    "League Leaders" In Wins

    http://nhlwc.cdnak.neulion.com/fs1/nhl/league/leagueleaders/iphone/wins/leagueleaders.json

    "League Leaders" In GAA

    http://nhlwc.cdnak.neulion.com/fs1/nhl/league/leagueleaders/iphone/gaa/leagueleaders.json

    "League Leaders" In Save Percentage

    http://nhlwc.cdnak.neulion.com/fs1/nhl/league/leagueleaders/iphone/savepercentage/leagueleaders.json

    "League Leaders" In Shutouts

    http://nhlwc.cdnak.neulion.com/fs1/nhl/league/leagueleaders/iphone/shutouts/leagueleaders.json

    Team Standings:​


    http://app.cgy.nhl.yinzcam.com/V2/Stats/Standings

    XML Data!

    NHL Game Center requires an "auth" code in order to obtain team standings, this URL is extracted from the same data and doesn't require authentication.

    or TSN's Standings:

    http://www.tsn.ca/datafiles/XML/NHL/standings.xml

    Also XML

    NHL News:​


    http://nhlwc.cdnak.neulion.com/fs1/nhl/league/news/NHL/iphone/1/news.json

    Player Mug Pictures​


    You need the id of the player in order to access this which can be obtained from their team roster:

    URL: http://3.cdn.nhle.com/photos/mugs/thumb/8476822.jpg

    Self explanatory, just change the ending to the desired player id.

    Default Image: http://3.cdn.nhle.com/photos/mugs/thumb/default.jpg

    UPDATE: Thanks to aksun for the following info:

    I found transparent high-quality player pictures from TSN site.

    Example picture

    API workaround:

    Code:
    GET http://tsnimages.tsn.ca/ImageProvider/PlayerHeadshot?seoId=[B][name][/B]
    
    So it's pretty easy to use it, just change the [name] to your player's name. There is a couple of things to keep in mind while using this system.
    • Latin alphabets only
    • replace spaces with hyphens(-)
    • replace aphostrophes(') and dots(.) with nothing

    PHP for replacing work:

    PHP:
    $name str_replace(array(" ""'""."), array("-"""""), $originalName);
    NHL Game Calendar​


    http://www.nhl.com/gamecenter/en/ajax/gamecalendarjson.htm?month=4&year=2011

    Games on the Specified Day​


    http://live.nhle.com/GameData/GCScoreboard/2013-02-01.jsonp

    This gives a good outlook on the games happening that day and also provides the Game ID's.

    Thanks to meetc for the following info!

    The returned JSON object can contain the following fields, some of them are not present prior to the start of the game.

    PHP:
    field                  datatype      descriptipon 
    ata                    char
    (3)       Away team acronym3 letter short name 
    atc                    text          Before
    blank During"progress" After"winner" if away team wins 
    atcommon               text          away team common name 
    atn                    text          away team city name 
    ats                    int           away team score 
    atsog                  int           Before
    null During and Afteraway team shots on goal 
    bs                     time
    /text     Beforestart time (unsure if local or ESTDuring05:10 2ndeg After"FINAL""FINAL OT" etc 
    bsc                    text          Before
    blank During"progress" After"final" 
    canationalbroadcasts   text          Canadian TV broadcasterscomma separated list 
    gcl                    Bool          gamecenter live
    gcll                   bool          gamecenter live
    gs                     int           game status1=secheduled3in progress5=finished 
    hta                    char
    (3)       home team acronym 
    htc                    text          Before
    blank During"progress" After"winner" if home team wins 
    htcommon               text          home team common name 
    htn                    text          home team city name 
    hts                    int           home team score 
    htsog                  int           Before
    null During and Afterhome team shots on goal 
    id                     int           game ID 
    rl                     Bool          true after game completed 
    usnationalbroadcasts   text          US tv broadcasters
    comma separated list 



    Game ID Explained:​


    For its web services, each game in the NHL is assigned a GameID which is needed in order to obtain/maintain data for that game. Here are a couple examples of GameIDs and their structure:

    Thanks to meetc for the following info!

    First 4 digits indicate the year which the season begins
    Digits 5,6 indicate the part of the season. 01 is pre-season, 02 is regular season, 03 is playoffs, 09 was used for the Sochi Olympics for the Mens Hockey
    Digits 7-10 are the game number for that part of the season. In pre-season and regular season, these are mostly sequential based on the date and time the game starts.
    In the playoffs digit 7 is always 0, digit 8 is the round of games (eg 1 preliminary, 2 quarters, 3 conference, 4 finals), digit 9 is a team matchup for that round, and digit 10 is the game number in that series.

    NOTE: For Neulion's Video Highlight service (which the NHL uses to manage NHL Game Center), you use the significant digits of the Game Code specified above. So if the game code is 0815, then in the video highlight URL, it will be 815.


    Neulion Highlights​


    This does not require the Game Center Live subscription!

    NHL.com requires you to have NHL GameCenter Live in order to view highlights, but the video is just an MP4 so you can easily track it down.





    UPDATE: 3/31/2014

    Well, you can now find the highlight video URL really easily.

    http://live.nhle.com/GameData/20132014/2013021122/gc/gcgm.jsonp

    Replace 2013021122 with the specified game id and 20132014 with the year of that game.

    This will return the highlight id's for each video, once you have the id, go to:

    http://video.nhl.com/videocenter/servlets/playlist?ids=2013021122-60-h&format=json

    Replace 2013021122-60-h with the your highlight id.

    It will look something like this:

    Which includes everything you'll need to obtain the video source and info!







    Ex. Highlight Video URL: http://e1.cdnak.neulion.com/nhl/vod...js_cgy_1314_h_discrete_CGY475_goal_1_1600.mp4


    The URL can be accessed without any credentials, let me explain the structure for the URL to view any highlight from a game.

    Base URL: http://e1.cdnak.neulion.com/nhl/vod/

    /2014/ - Year of the game
    /01/ - Month of the game
    /30/ - Day of the game
    /815/ - Game code (last 3 digits of the gameid)
    2_ - It is a static value, always 2
    815_ - Game code (last 3 digits of the gameid)
    sjs_ - Away team (San Jose Sharks)
    cgy_ - Home team (Calgary Flames)
    1314_ - Game season (2013 - 2014)
    h_discrete_ - Static value
    CGY - Home team (Calgary Flames)
    475_ - Highlight ID (You can obtain this from PlayByPlay.jsonp, gcbx.jsonp, gcsb.jsonp etc...)
    goal_ - Type of highlight (Goal, save, hit etc...)
    1_ - I don't really know what this value stands for, it is either 1 or 2
    1600 - Bitrate of the highlight (This is the only bitrate available)




    Sochi 2014 Olympic Stats:​





    Medals for each country:​


    http://mapi.sochi2014.com/v1/en/olympic/medal/rating


    Ice Hockey Schedule:​


    http://mapi.sochi2014.com/v1/en/olympic/results/IHSNR

    Ice Hockey Olympic News:​


    http://mapi.sochi2014.com/v1/en/olympic/news?page=1&pagesize=24&sport=IH

    Olympic Games Schedule for Specified Day:​


    http://mapi.sochi2014.com/v1/en/olympic/gamescalendar/?date=2014-02-06

    Just change the date parameter YYYY/MM/DD
     
    Last edited: Dec 6, 2014
    bur and 666 others likes this.
  2. Doctor No

    Doctor No Registered User

    Joined:
    Oct 26, 2005
    Messages:
    7,661
    Likes Received:
    888
    Trophy Points:
    139
    Home Page:
    Very interesting stuff!

    For hockeygoalies.org, I've always pulled all of my data by hand, just because I've seen enough errors in the data to cause me doubt.

    I'd still love to learn more about how to automate the process.
     
  3. Step7750

    Step7750 Registered User

    Joined:
    Jan 24, 2014
    Messages:
    55
    Likes Received:
    1
    Trophy Points:
    0
    Location:
    Calgary, Alberta
    Wow, I give you massive credit for doing that all manually.

    You could create a PHP Server Side script that runs once a day/week/hour etc.. that checks the roster of the teams that played that day (or every single team roster) and get the stats of the goalies. You would then put that data into a MySQL database that your web page would gather info from when a user visits it.

    You would have to tweak your website though since in order to extract data from MySQL, you would have to use a server side language like PHP which would then "echo" the tables with the stats.

    PHP Example:

    [​IMG]


    This PHP script generates a live scoreboard image based upon the parameters "gameid" and "date" on the url. It finds the team names, score, shots, plays, and logos, generates it and presents it to the user every single time the page is reloaded. Unlike HTML, it is impossible to see the source code of PHP since it runs server side. PHP files can also generate HTML documents pretty easily so it shouldn't be too much of a task.

    ex.

    Code:
    <html> 
     <title>Calgary Flames Goalie Stats</title>
     <body>
     <h1>CALGARY FLAMES GOALTENDING HISTORY: YEAR-BY-YEAR</h1>
    
     <?php
     // PHP Code:
     // Extract the data from your database and generate the appropriate tables with the data
     ?>
     
     </body>
     </html>
    

    To avoid the website reloading when going to a new page, you can use an AJAX call to post and receive the data from a PHP script. Efficiency :)

    Ex. http://stackoverflow.com/questions/16834138/javascript-function-post-and-call-php-script (or) http://www.w3schools.com/php/php_ajax_database.asp

    PHP is a pretty simple language, here is W3 Schools tutorial: http://www.w3schools.com/php/default.asp

    This forum (vBulletin) is based off of MySQL and PHP ;)

    There are some other ways to do this, but a MySQL database would be your best bet.
     
    Last edited: Feb 2, 2014
  4. Kane One

    Kane One Registered User

    Joined:
    Feb 6, 2010
    Messages:
    35,370
    Likes Received:
    357
    Trophy Points:
    125
    Location:
    Brooklyn, New NY
    Yep, PHP + MySQL is the only way to go.
     
  5. Doctor No

    Doctor No Registered User

    Joined:
    Oct 26, 2005
    Messages:
    7,661
    Likes Received:
    888
    Trophy Points:
    139
    Home Page:
    I do PHP/MySQL on my database side of things. Part of the downside of creating my site in 1994 was that I continued to update the page incrementally, so by the time I went to "databaseize" it, it took me more than two years.

    I still need a lot of practice pulling things down from other websites, though. That's next on the old Doug's new trick list. :laugh:
     
  6. hatterson

    hatterson Registered User

    Joined:
    Apr 12, 2010
    Messages:
    19,756
    Likes Received:
    1,079
    Trophy Points:
    156
    Occupation:
    Software Developer
    Location:
    North Tonawanda, NY
    Personally I'd roll SQL Server and asp.net MVC/Razor/C# but to each their own :)
     
  7. Fever

    Fever Registered User

    Joined:
    Feb 7, 2014
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Me also PHP/MySQL..

    Does anyone know much about this JSON data from NHL? Is it for their own GameCenter Live website and their apps?

    They dont provide any documentation or anything ... I was just looking for a game result json feed but I guess if you use the gamecenter json you can iterate through and get the results that way.

    Edit... Just saw this in the first post:
    http://live.nhle.com/GameData/GCScoreboard/2013-02-01.jsonp

    This is awesome!!


    I have a really good use for this data once I figure it out!
     
    Last edited: Feb 7, 2014
  8. Step7750

    Step7750 Registered User

    Joined:
    Jan 24, 2014
    Messages:
    55
    Likes Received:
    1
    Trophy Points:
    0
    Location:
    Calgary, Alberta
    This is the raw data for their NHL GameCenter Website/App services, there is no documentation (unless you worked on the infrastructure) but if you don't understand what a certain attribute means, feel free to ask; shouldn't take too long for me to analyze.

    Remember that the URL you linked above is in JSONP and thus needs the "loadScoreboard(***DATA***)" to be removed in order to parse it as JSON.

    You use PHP, so here is how you convert the JSONP to JSON:

    PHP:
    $dayscores "http://live.nhle.com/GameData/GCScoreboard/" $gamedate ".jsonp";
    $rawscores file_get_contents($dayscores);
    // Convert JSONP to JSON
    $rawscores preg_replace('/.+?(**.+}).+/','$1',$rawscores);
    $rawscores json_decode($rawscorestrue);
    To get more data for a specific game as well as more up to the second updated stats, use gcsb.jsonp or some of the other URLs listed.

    PHP:
    $scoresraw "http://live.nhle.com/GameData/20132014/" $gameid "/gc/gcsb.jsonp";
    $gamestats file_get_contents($scoresraw);
    $gamestats preg_replace('/.+?(**.+}).+/','$1',$gamestats);
    $gamestats json_decode($gamestatstrue);
     
    Last edited: Feb 8, 2014
  9. meetc

    meetc Registered User

    Joined:
    Jun 30, 2014
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    4
    Thanks a lot for all these data sources, I'm using a few of them for a project I'm working on. I have a few updates for the descriptions of the data sources.

    Game ID Explained:

    First 4 digits indicate the year which the season begins
    Digits 5,6 indicate the part of the season. 01 is pre-season, 02 is regular season, 03 is playoffs, 09 was used for the Sochi Olympics for the Mens Hockey
    Digits 7-10 are the game number for that part of the season. In pre-season and regular season, these are mostly sequential based on the date and time the game starts.
    In the playoffs digit 7 is always 0, digit 8 is the round of games (eg 1 preliminary, 2 quarters, 3 conference, 4 finals), digit 9 is a team matchup for that round, and digit 10 is the game number in that series.


    Games on the Specified Day:
    GCScoreboard/yyyy-mm-dd.jsonp

    JSON object can contain the following fields, some of them are not present prior to the start of the game.

    PHP:
    field                  datatype      descriptipon
    ata                    char
    (3)       Away team acronym3 letter short name
    atc                    text          Before
    blank During"progress" After"winner" if away team wins
    atcommon               text          away team common name
    atn                    text          away team city name
    ats                    int           away team score
    atsog                  int           Before
    null During and Afteraway team shots on goal
    bs                     time
    /text     Beforestart time (unsure if local or ESTDuring05:10 2ndeg After"FINAL""FINAL OT" etc
    bsc                    text          Before
    blank During"progress" After"final"
    canationalbroadcasts   text          Canadian TV broadcasterscomma separated list
    gcl                    Bool          gamecenter live?
    gcll                   bool          gamecenter live?
    gs                     int           game status1=secheduled3in progress5=finished
    hta                    char
    (3)       home team acronym
    htc                    text          Before
    blank During"progress" After"winner" if home team wins
    htcommon               text          home team common name
    htn                    text          home team city name
    hts                    int           home team score
    htsog                  int           Before
    null During and Afterhome team shots on goal
    id                     int           game ID
    rl                     Bool          true after game completed
    usnationalbroadcasts   text          US tv broadcasters
    comma separated list
     
  10. Step7750

    Step7750 Registered User

    Joined:
    Jan 24, 2014
    Messages:
    55
    Likes Received:
    1
    Trophy Points:
    0
    Location:
    Calgary, Alberta
    Thanks for the info, I've added it to the first post!

    All the best for your project
     
  11. Johne

    Johne Registered User

    Joined:
    Jul 16, 2006
    Messages:
    82
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Dallas, TX
    Home Page:
    I'm still trying to find standings in json. any help would be appreciated.
     
  12. Step7750

    Step7750 Registered User

    Joined:
    Jan 24, 2014
    Messages:
    55
    Likes Received:
    1
    Trophy Points:
    0
    Location:
    Calgary, Alberta
  13. aksun

    aksun Registered User

    Joined:
    Oct 6, 2014
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Oulu, Finland
    I found transparent high-quality player pictures from TSN site.

    Example picture

    API workaround:

    Code:
    GET http://tsnimages.tsn.ca/ImageProvider/PlayerHeadshot?seoId=[B][name][/B]
    
    So it's pretty easy to use it, just change the [name] to your player's name. There is a couple of things to keep in mind while using this system.
    • Latin alphabets only
    • replace spaces with hyphens(-)
    • replace aphostrophes(') and dots(.) with nothing

    PHP for replacing work:

    PHP:
    $name str_replace(array(" ""'""."), array("-"""""), $originalName);
    OP can edit this to the first post if he wants to.
     
    Last edited: Oct 18, 2014
  14. Step7750

    Step7750 Registered User

    Joined:
    Jan 24, 2014
    Messages:
    55
    Likes Received:
    1
    Trophy Points:
    0
    Location:
    Calgary, Alberta
    Great work, but I just don't understand why any reputable company would switch between alpha and numeric parameters for their calls since TSN also assigns ID's to each player.

    I've added it to the OP.
     
    Last edited: Oct 25, 2014
  15. Ail

    Ail Dear Friend Pape

    Joined:
    Nov 13, 2009
    Messages:
    27,436
    Likes Received:
    1,554
    Trophy Points:
    139
    Gender:
    Male
    Occupation:
    Nothingmaster
    Location:
    Mysidia, PA
    Oh, that is pretty cool. Thanks dude!
     
  16. King Karl

    King Karl Swagalicious

    Joined:
    Mar 18, 2014
    Messages:
    551
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Halifax, NS
    Very cool stuff. Is there a way to have your tables in SQL automatically check for new stats and have them update themselves?
     
  17. aksun

    aksun Registered User

    Joined:
    Oct 6, 2014
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Oulu, Finland
    I don't think that's possible. At least MySQL is not for that purpose(crawling data). But it's not hard to make a php script to update the table. Use cron jobs for the automatic script run.

    good luck.
     
  18. King Karl

    King Karl Swagalicious

    Joined:
    Mar 18, 2014
    Messages:
    551
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Halifax, NS
    Ah ok. I'm not overly familiar with PHP, but I've got a while to learn it. Any pointers you could give to a beginner about interacting between PHP and MySQL?
     
  19. aksun

    aksun Registered User

    Joined:
    Oct 6, 2014
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Oulu, Finland
    You should use PDO for the MySQL link, it's best practise nowadays. Don't use mysql_* functions, they are deprecated in PHP.
     
  20. teris

    teris Registered User

    Joined:
    Dec 6, 2006
    Messages:
    195
    Likes Received:
    0
    Trophy Points:
    0
    First of all, many thanks for this thread everyone. Started two different projects thanks to the information here. Figured I should share my own findings as well so here goes.

    Just to add to this here's what I received once right before the game was about to start with the relevant parts bolded:
    Code:
    {
          "atcommon": "DUCKS",
          "canationalbroadcasts": "",
          "ata": "ANA",
          "rl": false,
          "atsog": 0,
          [B]"bs": "PREGAME"[/B],
          "htcommon": "AVALANCHE",
          "id": 2014020168,
          "atn": "ANAHEIM",
          "hts": "",
          "atc": "progress",
          "htn": "COLORADO",
          "usnationalbroadcasts": "",
          "gcl": true,
          "hta": "COL",
          "ats": "",
          "htc": "progress",
          "htsog": 0,
          "bsc": "progress",
          [B]"gs": 2[/B],
          "gcll": true
    }
    I would assume that "gs": 4 would mean post game broadcasting but I haven't witnessed it. I can confirm that it's US/Eastern time if "bs" has a start time. Secondly...

    "h_discrete" is not actually static but two different variables. Replace "h" with "a" to get the away feed of the same highlight. It works most of the time including your example but sometimes only home or away is available. Next thing seems to be mostly for goals and home feeds but you can sometimes replace "discrete" with "ingame". It just gives you the same highlight but shorter with less buildup and no replays. There's also another base url. To demonstrate...

    http://nhl.cdnllnwnl.neulion.net/u/nhlmobile/vod/nhl/2014/11/08/204/2_204_nyr_tor_1415_h_discrete_tor579_goal_1_1600.mp4

    http://nhl.cdnllnwnl.neulion.net/u/nhlmobile/vod/nhl/2014/11/08/204/2_204_nyr_tor_1415_a_discrete_tor579_goal_1_1600.mp4

    http://nhl.cdnllnwnl.neulion.net/u/nhlmobile/vod/nhl/2014/11/08/204/2_204_nyr_tor_1415_h_ingame_tor579_goal_1_1600.mp4
     
  21. Step7750

    Step7750 Registered User

    Joined:
    Jan 24, 2014
    Messages:
    55
    Likes Received:
    1
    Trophy Points:
    0
    Location:
    Calgary, Alberta
    Yeah, I saw this a long time ago when I was generating a tables that stored the URLs of every "highlight" for the past couple of years.

    Also, it is hilarious that the full-length replays of each game do not require any credentials; so I just got the replays of every game for the past couple of years in a table by replicating the URL structure. At least the streams require credentials to view them.
     
  22. Doctor No

    Doctor No Registered User

    Joined:
    Oct 26, 2005
    Messages:
    7,661
    Likes Received:
    888
    Trophy Points:
    139
    Home Page:
    I decided that this would be a valuable thread to sticky.
     
  23. King Karl

    King Karl Swagalicious

    Joined:
    Mar 18, 2014
    Messages:
    551
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Halifax, NS
    Ok, so for a project, I'm looking to pull statistics from here, and the update an SQL database automatically with the information. I'd also like to do this for every team. How would I go about doing this? Most importantly though, is how would I take the information from that page and turn it into an SQL query, solely using PHP?
    (I literally only started using PHP yesterday)
     
    Last edited: Nov 23, 2014
  24. Step7750

    Step7750 Registered User

    Joined:
    Jan 24, 2014
    Messages:
    55
    Likes Received:
    1
    Trophy Points:
    0
    Location:
    Calgary, Alberta
    Do know programming basics such as looping and recursion? If not, you should spend time in that area before you undertake any project.

    Here are some tips:

    - Loop through the url with an array consisting of the abbreviations:

    "devils": "NJD",
    "islanders": "NYI",
    "rangers": "NYR",
    "flyers": "PHI",
    "penguins": "PIT",
    "bruins": "BOS",
    "sabres": "BUF",
    "canadiens": "MTL",
    "senators": "OTT",
    "mapleleafs": "TOR",
    "hurricanes": "CAR",
    "panthers": "FLA",
    "lightning": "TBL",
    "capitals": "WSH",
    "blackhawks": "CHI",
    "redwings": "DET",
    "predators": "NSH",
    "blues": "STL",
    "flames": "CGY",
    "avalanche": "COL",
    "oilers": "EDM",
    "canucks": "VAN",
    "ducks": "ANA",
    "stars": "DAL",
    "kings": "LAK",
    "coyotes": "PHX",
    "sharks": "SJS",
    "bluejackets": "CBJ",
    "wild": "MIN",
    "jets": "WPG"

    - While I don't particularly like W3Schools, try to figure out the structure of the Insert and Update statements for SQL (http://www.w3schools.com/sql/sql_insert.asp).

    - You'll need to parse the json on the page using "json_decode" (http://php.net/manual/en/function.json-decode.php) and then loop through the given array to extract the needed info

    - You may want a tool such as phpMyAdmin (http://www.phpmyadmin.net/home_page/index.php) to allow easier administration for the database(s)
     
  25. King Karl

    King Karl Swagalicious

    Joined:
    Mar 18, 2014
    Messages:
    551
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Halifax, NS
    Awesome. Thanks so much for your help. I'll post the finished product on here when it's done.
     

Share This Page

monitoring_string = "358c248ada348a047a4b9bb27a146148"