fewieden / MMM-NFL

National Football League Module for MagicMirror²
MIT License
28 stars 10 forks source link

2021 Season (prototype for new API provider available) #44

Closed k-samani closed 2 years ago

k-samani commented 3 years ago

Today is the start of a new season. I have noticed that this module is not updating. Any suggestions? I tried to update url but saw that it does not exist or I don't have access to. Any help is appreciated.

fewieden commented 3 years ago

@k-samani this is a known issue with this API.

The pre-season was never covered. In the previous years, it showed the old season until the first or second matchday of the regular season. After that the update worked normal again.

k-samani commented 3 years ago

Understood. With this code, it is showing "NFL REGULAR SEASON 2021 WEEK UNDEFINED" and "Loading" under it. So, when the regular season starts, it should correctly pull the data?

jupadin commented 3 years ago

Given the current endpoint api (http://static.nfl.com/liveupdate/scorestrip/ss.xml) you only get the games from last season, week 17.

I also heard some rumors that the closed the API and that the data for the new season won't be longer available. Hopefully this is only a rumor and does not reflect the current situation...

In case you get any data for the new season, please let me know - I'm also interested if there are new updates regarding the API.

k-samani commented 3 years ago

I did another git clone and this is what is showing ...sorry for bad picture...I'll wait until the season starts and see if it updates

20210816_145543.jpg

jupadin commented 3 years ago

Despite waiting until the new season starts, there should be data available anyways. Seems like - quick reviewing the code - there is somewhere an error, since both urls in node_helper.js return data.

As long as both urls do not return any data regarding the new season or having another api available, there is not much hope i guess...

fewieden commented 3 years ago

@k-samani @jupadin as mentioned before the API is always behind until the season starts. There are various forums reporting over no data every year. So far it always was up-to-date from matchday 1 or 2. In one extreme case, I think it was already matchday 5-7.

There was once a valid alternative with JSON data structure, which would simplify the logic of this module, but it lacked the information of the match start so I didn't move on, as I consider this crucial information for this module.

Regarding your screenshot. I just had a look in my developing machine and this is how it looks for me:

image

Can you check if you get any errors in the developer console (press ctrl + shift + i for electron) and the nodejs logs in the terminal.

jupadin commented 3 years ago

@fewieden, thank you for this clarification. I'm reassured by that and am even more eagerly awaiting the start of the season.

The JSON option with the missing start times is actually very impractical and not usable in use or with the purpose of the module.

Plainbroke commented 3 years ago

Sooooo, What are you saying in MagicMirror modules for dummies language?

fewieden commented 3 years ago

@Plainbroke can you point out which part was not understandable for you and I will try to explain it in different words

jfc0316 commented 3 years ago

Has any progress been made on this? Mine still does not update with the 2021 data and still shows last game of last season. How do you update?

fewieden commented 3 years ago

@jfc0316 the API still returns the data for the previous season

jfc0316 commented 3 years ago

Do you know if they have plans to fix or not?

Jason Cox

On Sep 13, 2021, at 2:25 AM, fewieden @.***> wrote:

 @jfc0316 the API still returns the data for the previous season

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

dantheman369 commented 3 years ago

Does look like the NFL stopped supporting that API. Maybe switch to a different one? ESPN seems to have one for free : https://gist.github.com/akeaswaran/b48b02f1c94f873c6655e7129910fc3b (Have to pick the API lower down. Github mods apparently hate direct linking.)

DukeX21 commented 3 years ago

when will the update for the regular season come. When loading, 2021 will be displayed. But if the games are loaded, they are from week 17 on 2020

cowboysdude commented 3 years ago

NFL no longer giving that data for free apparently...... sad really they make 5 billion dollars a year you'd think they would continue that.....

k-samani commented 3 years ago

I created a code in Python. Would it be useful? I know Magic Mirror uses Node.js but would it be difficult to convert? I have very little experience with Node.js. But here is what I came up with >> https://github.com/k-samani/NFL_score_pyton.git

fewieden commented 3 years ago

I will try to build a prototype with the ESPN API on Sunday.

Plainbroke commented 3 years ago

Oh, Thank You. My wife and I both like the NFL scoreboard

Jeff Burdick

From: fewieden Sent: Friday, October 1, 2021 1:24 PM To: fewieden/MMM-NFL Cc: Jeff; Mention Subject: Re: [fewieden/MMM-NFL] New Season (#44)

I will try to build a prototype with the ESPN API on Sunday. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

jfc0316 commented 3 years ago

That would be awesome if you could! I keep thinking one of these weekends I will look and see it updated, no dice thus far! 😩

Jason Cox

On Oct 1, 2021, at 2:28 PM, Jeff @.***> wrote:

 Oh, Thank You. My wife and I both like the NFL scoreboard

Jeff Burdick

From: fewieden Sent: Friday, October 1, 2021 1:24 PM To: fewieden/MMM-NFL Cc: Jeff; Mention Subject: Re: [fewieden/MMM-NFL] New Season (#44)

I will try to build a prototype with the ESPN API on Sunday. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

fewieden commented 3 years ago

@k-samani @jupadin @Plainbroke @jfc0316 @dantheman369 @DukeX21 @cowboysdude I already have something working. I tried to make the minimal required changes to make this work asap. Once we find the most issues, there is a lot of work ahead to get this module in shape again. This was one of my first modules and I would probably rewrite it from scratch.

It looks like finished and scheduled games are working so far.

nfl

Tested:

Unsupported:

I would like to ask you to test the module yourselves with your config options to find other possible issues and also keep an eye out during live games.

If you already have the module installed you can try the prototype by executing the following commands.

cd ~/MagicMirror/modules/MMM-NFL
git checkout develop
git pull
npm install --production

I also suggest enabling the default module updatenotification to see on the mirror that the prototype has an update available.

jfc0316 commented 3 years ago

Hey! And thanks again! I was so excited to wake up this morning and see that you already had some thing up and running!

I tried it this morning and this is the error message that I got.

Jason Cox

On Oct 2, 2021, at 5:11 AM, fewieden @.***> wrote:

 @k-samani @jupadin @Plainbroke @jfc0316 @dantheman369 @DukeX21 @cowboysdude I already have something working. I tried to make the minimal required changes to make this work asap. Once we find the most issues, there is a lot of work ahead to get this module in shape again. This was one of my first modules and I would probably rewrite it from scratch.

It looks like finished and scheduled games are working so far.

Tested:

Scheduled games Live games (game period, remaining time in quarter, score) Current quarter Remaining time in quarter Overtime Finished games Preseason Postseason Super Bowl Offseason Switching automatically to next game week Switching automatically to post season Voice commands to display statistics Unsupported:

Fetching data (every minute) during live games I would like to ask you to test the module yourselves with your config options to find other possible issues and also keep an eye out during live games.

If you already have the module installed you can try the prototype by executing the following commands.

cd ~/MagicMirror/modules/MMM-NFL git checkout develop git pull npm install --production I also suggest enabling the default module updatenotification to see on the mirror that the prototype has an update available.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

fewieden commented 3 years ago

@jfc0316 your message doesn't contain an error. Can you try posting it again via Github instead of mail

k-samani commented 3 years ago

I get the following when I do git checkout develop and try to git pull:

image

k-samani commented 3 years ago

got it to pull. i did a 'git reset --hard' and 'git pull' and it updated. image

k-samani commented 3 years ago

I am just having a hard time figuring out what I need to update in the updatenotficatiion. Looks like this right now: `/* Magic Mirror

k-samani commented 3 years ago

is it this part >> moduleList: {}, ?

jfc0316 commented 3 years ago

@fewieden @k-samani I was having the exact same issue but I think mine might go a little deeper. I am seeing issues with alot of modules and I am noticing that everything modules ends up at "node-gyp-build" freezes for a second, and then eventually ends up as an error.

jfc0316 commented 3 years ago

scratch that, it's working! Thanks @fewieden and @k-samani Now I've got to figure out what's wrong with the MMM-Detector module. I think the node-gyp-build error is related to that ....

fewieden commented 3 years ago

@k-samani you don't need to modify the module. Simply add the following to your config.js file

{
  module: "updatenotification",
  position: "top_bar"
},

it will automatically scan the git repositories of all your installed modules

k-samani commented 3 years ago

Thank you.

fewieden commented 3 years ago

During the live games, they changed the order of the games. Sorting now always by date to have the finished games at the top.

1st quarter

k-samani commented 3 years ago

Seems like it is updating live. I have mine set to 3 minutes. 20211003_123229.jpg

k-samani commented 3 years ago

And it pushed the finished game at the bottom which is fine by me

fewieden commented 3 years ago

@k-samani yeah but Monday Night Football was still listed after the finished game.

Displaying now also halftime status

halftime

k-samani commented 3 years ago

I think it goes by day. I think it will update the order tomorrow. Speaking of update, mine stopped updating the scores. I quit Magic mirror and do npm start, it updates the scores initially but not after

fewieden commented 3 years ago

@k-samani but Bengals vs. Jaguars was already Thursday Night Football, it shouldn't be mixed with Sunday.

It is still updating for me. Do you see any logs in the electron console or terminal?

Now also with support for overtime

overtime

k-samani commented 3 years ago

actually, i do see this: Error getting NFL scores FetchError: request to http://site.api.espn.com/apis/site/v2/sports/football/nfl/scoreboard failed, reason: getaddrinfo ENOTFOUND site.api.espn.com

k-samani commented 3 years ago

did a git pull and something changed... probably something i messed up pi@raspberrypi:~/MagicMirror/modules/MMM-NFL $ git pull From https://github.com/fewieden/MMM-NFL d2068a9..baf1f35 develop -> origin/develop Updating d2068a9..baf1f35 Fast-forward espn.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-)

fewieden commented 3 years ago

@k-samani the last part is caused because I made commits during the live games

commits

k-samani commented 3 years ago

Gotcha..worked after I did git pull

k-samani commented 3 years ago

Thank you for getting this fixed. Not sure if my python helped any but thank you.

dantheman369 commented 3 years ago

Thanks so much, fewieden! Really appreciate your time and effort in making this thing work. I will give things a go when I get home tonight.

jfc0316 commented 3 years ago

Absolutely second that!!! Thank you so much!

Jason Cox

On Oct 5, 2021, at 4:00 PM, dantheman369 @.***> wrote:

 Thanks so much, fewieden! Really appreciate your time and effort in making this thing work. I will give things a go when I get home tonight.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

fewieden commented 3 years ago

Bye weeks are also working as before

bye week

k-samani commented 3 years ago

is there an option for the teams with bye week to show up? I did a git pull and mine doesn't show bye week. image

jupadin commented 3 years ago

yeah, it should be the focus_on option. There you can specify an array of strings (["GB", "NE", ...]) for which the bye week should be shown...

k-samani commented 3 years ago

Makes sense. Thank you.

MiTechneek commented 2 years ago

Please be patient with me here, this is my first time commenting on github. For the most part I've been able to fix my issues with some deep soul searching, and persistent internet combing. This time, however, I am at a loss. I've followed the instructions to a T everything seems to be going correctly. Then I get a message that I need to audit fix. After I enter the command, the same 3 vulnerabilities return to be npm audit fix'd again. When I run magic mirror I get 2022 season... undefined. If I try and tweak anything it reverts back to 2021 week 17. What stupid thing am I doing!?!?!

Thanks for any help 20220111_133101 20220111_133139 20220111_133507 20220111_132828

Follow up... I'm an idiot it works Thx for this thread!! I will now fade back into the shadows, hopefully MMM-NHL is just as easy!

fewieden commented 2 years ago

Thanks, everyone for testing. I released it now to the master branch. You can switch your branch again by

cd ~/MagicMirror/modules/MMM-NFL
git checkout master
git pull
npm install --production