Closed k-samani closed 2 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.
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?
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.
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
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...
@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:
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.
@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.
Sooooo, What are you saying in MagicMirror modules for dummies language?
@Plainbroke can you point out which part was not understandable for you and I will try to explain it in different words
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?
@jfc0316 the API still returns the data for the previous season
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.
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.)
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
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.....
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
I will try to build a prototype with the ESPN API on Sunday.
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.
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.
@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:
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.
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.
@jfc0316 your message doesn't contain an error. Can you try posting it again via Github instead of mail
I get the following when I do git checkout develop and try to git pull:
got it to pull. i did a 'git reset --hard' and 'git pull' and it updated.
I am just having a hard time figuring out what I need to update in the updatenotficatiion. Looks like this right now: `/* Magic Mirror
MIT Licensed. / Module.register("updatenotification", { // Define module defaults defaults: { updateInterval: 10 60 1000, // every 10 minutes refreshInterval: 24 60 60 1000, // one day ignoreModules: [], timeout: 5000 },
suspended: false,
moduleList: {},
// Override start method.
start: function () {
Log.info("Starting module: " + this.name);
setInterval(() => {
this.moduleList = {};
this.updateDom(2);
}, this.config.refreshInterval);
},
notificationReceived: function (notification, payload, sender) {
if (notification === "DOM_OBJECTS_CREATED") {
this.sendSocketNotification("CONFIG", this.config);
this.sendSocketNotification("MODULES", Module.definitions);
//this.hide(0, { lockString: this.identifier });
}
},
// Override socket notification handler.
socketNotificationReceived: function (notification, payload) {
if (notification === "STATUS") {
this.updateUI(payload);
}
},
updateUI: function (payload) {
if (payload && payload.behind > 0) {
// if we haven't seen info for this module
if (this.moduleList[payload.module] === undefined) {
// save it
this.moduleList[payload.module] = payload;
this.updateDom(2);
}
//self.show(1000, { lockString: self.identifier });
} else if (payload && payload.behind === 0) {
// if the module WAS in the list, but shouldn't be
if (this.moduleList[payload.module] !== undefined) {
// remove it
delete this.moduleList[payload.module];
this.updateDom(2);
}
}
},
diffLink: function (module, text) {
const localRef = module.hash;
const remoteRef = module.tracking.replace(/.*\//, "");
return '<a href="https://github.com/MichMich/MagicMirror/compare/' + localRef + "..." + remoteRef + '" ' + 'class="xsmall dimmed" ' + 'style="text-decoration: none;" ' + 'target="_blank" >' + text + "</a>";
},
// Override dom generator.
getDom: function () {
const wrapper = document.createElement("div");
if (this.suspended === false) {
// process the hash of module info found
for (const key of Object.keys(this.moduleList)) {
let m = this.moduleList[key];
const message = document.createElement("div");
message.className = "small bright";
const icon = document.createElement("i");
icon.className = "fa fa-exclamation-circle";
icon.innerHTML = " ";
message.appendChild(icon);
const updateInfoKeyName = m.behind === 1 ? "UPDATE_INFO_SINGLE" : "UPDATE_INFO_MULTIPLE";
let subtextHtml = this.translate(updateInfoKeyName, {
COMMIT_COUNT: m.behind,
BRANCH_NAME: m.current
});
const text = document.createElement("span");
if (m.module === "default") {
text.innerHTML = this.translate("UPDATE_NOTIFICATION");
subtextHtml = this.diffLink(m, subtextHtml);
} else {
text.innerHTML = this.translate("UPDATE_NOTIFICATION_MODULE", {
MODULE_NAME: m.module
});
}
message.appendChild(text);
wrapper.appendChild(message);
const subtext = document.createElement("div");
subtext.innerHTML = subtextHtml;
subtext.className = "xsmall dimmed";
wrapper.appendChild(subtext);
}
}
return wrapper;
},
},
suspend: function () {
this.suspended = true;
},
resume: function () {
this.suspended = false;
this.updateDom(2);
}
}); `
is it this part >> moduleList: {},
?
@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.
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 ....
@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
Thank you.
During the live games, they changed the order of the games. Sorting now always by date to have the finished games at the top.
Seems like it is updating live. I have mine set to 3 minutes.
And it pushed the finished game at the bottom which is fine by me
@k-samani yeah but Monday Night Football was still listed after the finished game.
Displaying now also halftime status
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
@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
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
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(-)
@k-samani the last part is caused because I made commits during the live games
Gotcha..worked after I did git pull
Thank you for getting this fixed. Not sure if my python helped any but thank you.
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.
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.
Bye weeks are also working as before
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.
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...
Makes sense. Thank you.
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
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!
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
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.