jclarke0000 / MMM-MyScoreboard

Module for MagicMirror to display today's scores for your favourite teams across multiple sports.
MIT License
71 stars 31 forks source link

Games not updating #90

Open zheinrich1 opened 4 months ago

zheinrich1 commented 4 months ago

Every day the time of the games does change to the correct time, but once the game starts it doesn’t change. It will remain showing the time the game started and not update scores anymore or say final when it’s done

crcowan commented 4 months ago

It looks like the SportsNet feed is not updating during the day. It always shows scores of zero.

Dysantic commented 4 months ago

Sportsnet made a change to the hostname for the API, yet their old hostname (and the one this module uses) still has access to the "pre-game" data, which is why we still see the game time, but no live updates or post-game scores.

A quick fix is to go into the "SNET.js" file, and look for:

var url = "https://mobile-statsv2.sportsnet.ca/ticker?day=" + this.gameDate.format("YYYY-MM-DD");

Update the hostname from "mobile-statsv2.sportsnet.ca" to "stats-api.sportsnet.ca" like so:

var url = "https://stats-api.sportsnet.ca/ticker?day=" + this.gameDate.format("YYYY-MM-DD");

The API output is still formatted as the module expects, and all should work again.

crcowan commented 4 months ago

Thank you so much for the incredibly fast response. I figured it was something like this but couldn't find any documentation on the API.

I really appreciate your help,.

Regaards, Charles

------ Original Message ------ From "Dysantic" @.> To "jclarke0000/MMM-MyScoreboard" @.> Cc "crcowan" @.>; "Comment" @.> Date 6/30/2024 10:48:43 PM Subject Re: [jclarke0000/MMM-MyScoreboard] Games not updating (Issue

90)

Sportsnet made a change to the hostname for the API, yet their old hostname (and the one this module uses) still has access to the "pre-game" data, which is why we still see the game time, but no live updates or post-game scores.

A quick fix is to go into the "SNET.js" file, and look for:

var url = "https://mobile-statsv2.sportsnet.ca/ticker?day=" + this.gameDate.format("YYYY-MM-DD");

Update the hostname from "mobile-statsv2.sportsnet.ca" to "stats-api.sportsnet.ca" like so:

var url = "https://stats-api.sportsnet.ca/ticker?day=" + this.gameDate.format("YYYY-MM-DD");

The API output is still formatted as the module expects, and all should work again.

— Reply to this email directly, view it on GitHub https://github.com/jclarke0000/MMM-MyScoreboard/issues/90#issuecomment-2199065065, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABJNTP45MVKSNWSALRCMYWTZKC7QXAVCNFSM6AAAAABKDUF6GWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOJZGA3DKMBWGU. You are receiving this because you commented.Message ID: @.***>

dathbe commented 4 months ago

Thanks for the update, @Dysantic . I've included this change in my fork. The only other significant change is a backward-compatible option to display both yesterday's game and today's game at the same time in the morning. https://github.com/dathbe/MMM-MyScoreboard/tree/snetupdate

I've created my own fork because the owner here doesn't seem to be updating.

ChrisRG711 commented 3 months ago

that fixed me!!! Thank you a ton

zheinrich1 commented 3 months ago

i appreciate the super quick help. i was unable to find the time to try it out, but today i spent quite a bit of time on it, and it would not work by manually editing the file. i dont know if something else needed to be done as well. but i ended up deleting the MMM-MyScoreboard directory and reinstalling it via @Dysantic 's fork.

A funny story for you all, i accidentally did git pull -rebase MMM-MyScoreboard in the MagicMirror folder. what a mess. what a terrible mess. git reset --hard ORIG_HEAD fixed it luckily but then i had to npm install again in the MM folder which took forever and i thought it was broken. long story short is that git clone is what im supposed to use, not git pull lol

anyways, i will close the issue as i confirmed tonight via the Phillies game info that it is now working with your guys' help. much appreciated

dathbe commented 3 months ago

1) we’ve found a fix, but it hasn’t been merged into the main branch. I don’t know the protocol, but maybe leave the issue open in case someone else is looking for the solution?

2) when the manual edit wasn’t working, did you ‘npm install’ and restart MagicMirror? Some things don’t get picked up by the browser without a restart.

zheinrich1 commented 3 months ago

sounds good, ill reopen it. I wasnt aware that it went to a different location when closed.

Thinking back, i think my issue was when i edited the file, i copied and pasted the url in, but deleted the "https://" and only copied over the rest. maybe that was it, maybe not. The mirror i did it on has been untouched for a while so i havent updated anything in a long time.

however, the second mirror in my house, worked right away when i manually did it. didnt need to reboot it or anything.

thanks again for all the help.

yguns31 commented 3 months ago

FYI, it appears there is a change in the functionality to the new URL. It only shows MLB games. If you want to see scores for any other leagues, you need to append 'league=NFL' to the querystring. This may break how the module functions.

sanj926 commented 2 months ago

UGH. Just noticed it’s only working for MLB games. What do I need to do to get it to work with NFL and NCAAF?

snp66 commented 2 months ago

Is the pointer to the old api not working now? I’ve not changed anything and again scores are not updating. I’ve tried changing to a different source but the score is processed as a soccer or basketball game so the innings don’t display properly.

sanj926 commented 2 months ago

Just checked and the new api is only showing MLB. There is an NFL game today that is not showing up at all. The old apinshows the games but doesn’t update the scores.

snp66 commented 2 months ago

ESPN has the scores but the code isn’t setup to parse MLB from the ESPN API. At least that’s what it appeared to me when I tried it. I’m far from an expert though.

sanj926 commented 2 months ago

Well, the problem is that it’s not pulling in any of the NFL games on the newer api. So it only pulls in the MLB games. The old API pulls in the right games but doesn’t update the scores.

sigel commented 2 months ago

FYI, it appears there is a change in the functionality to the new URL. It only shows MLB games. If you want to see scores for any other leagues, you need to append 'league=NFL' to the querystring. This may break how the module functions.

This works, and you can add multiple like league=MLB,NFL

var url = "https://stats-api.sportsnet.ca/ticker?league=MLB,NFL&day=" + this.gameDate.format("YYYY-MM-DD");

However this introduces a new issue mentioned in the code comments in SNET.js where games for the next day show as of 7:00PM est, and scores from yesterdays NFL games are still showing for me as well. Hopefully someone with more js experience can provider a true fix.