Page 1 of 2

Live Scoreboard not working

Posted: Fri Sep 07, 2018 12:30 am
by chuckie365
It looks like the NFL has discontinued support of the original scoreboard api

http://www.nfl.com/liveupdate/scorestrip/ss.xml

Anybody know how to resolve this problem in the scoreboard.js file to make it work again?

thanks!

Re: Live Scoreboard not working

Posted: Fri Sep 07, 2018 10:11 am
by Smokey Jones
I discovered that last night as well. From what I can tell, the NFL has gone to an API at http://www.nfl.com/liveupdate/scores/scores.json but I have no idea how to code for that. I think it's going to take a complete rewrite of the socreboard.js file.

Re: Live Scoreboard not working

Posted: Sun Sep 09, 2018 8:10 am
by jhronesz
The current link is an XML link. http://www.nfl.com/ajax/scorestrip?seas ... REG&week=1 contains the same data, but doesn't end in XML. I am not sure if anyone knows how we could incorporate this link into the site. Pasting it into the code doesn't work, probably because it doesn't end in .xml. Adding .xml to the end of the link makes the link not work.

Re: Live Scoreboard not working

Posted: Sun Sep 09, 2018 6:24 pm
by Russaholic
Thanks for posting about this. I was trying to figure it out on my own and was getting frustrated. You saved me from further distress.

Re: Live Scoreboard not working

Posted: Tue Sep 11, 2018 7:57 am
by baldy51497
Forgive my coding ignorance, I am just a HS Math teacher doing this for my work pool. However, I used the url that jhronesz posted. It worked, I just had to change the script line 26 from "?random=... to "&random=... since we were just increasing the number of variables being passed to the server and not starting it.

However, how are we going to make this url use a dynamic week number? Or, how are we going to get the week number variable from the site into this script?

Re: Live Scoreboard not working

Posted: Tue Sep 11, 2018 10:49 am
by GiantsFan
UPDATE 9/17: Don't use this anymore. They fixed the original XML file, so this isn't necessary.

I believe I figured this out.. need to add one new line to common.asp to get the current week from the pool, and change 3 lines in scoreboard.js to change to the new URL and append the week value. I've made a lot of custom changes to my code, so i can't go with line numbers. Hopefully by providing old and new, that should be enough.

Note: This might break during postseason since I'm not sure how the week number will be formatted, so this might be revisited in January.

includes/common.asp
Old

Code: Select all

if ENABLE_SCORES_ADDON then
	Response.Write(vbTab & "<script type=""text/javascript"" src=""scripts/scoreboard.js""></script>" & vbCrLf)
end if
New

Code: Select all

if ENABLE_SCORES_ADDON then
	Response.Write(vbTab & "<script type=""text/javascript"">var currentSBWeek =" & getCurrentWeek() & ";</script>" & vbCrLf) 
	Response.Write(vbTab & "<script type=""text/javascript"" src=""scripts/scoreboard.js""></script>" & vbCrLf)
end if
scripts/scoreboard.js
Old

Code: Select all

var isPlayoffs = false;
var scoresUrl = "http://www.nfl.com/liveupdate/scorestrip/ss.xml";
if (isPlayoffs)
	scoresUrl = "http://www.nfl.com/liveupdate/scorestrip/postseason/ss.xml";
New

Code: Select all

var isPlayoffs = false;
var scoresUrl = "http://www.nfl.com/ajax/scorestrip?season=2018&seasonType=REG&week=" + currentSBWeek;
if (isPlayoffs)
	scoresUrl = "http://www.nfl.com/ajax/scorestrip?season=2018&seasonType=POST&week=" + currentSBWeek;
Old

Code: Select all

xhr.queryString = "url=" + escape(scoresUrl + "?random=" + Math.floor(Math.random() * 10000000));
New

Code: Select all

xhr.queryString = "url=" + escape(scoresUrl + "&random=" + Math.floor(Math.random() * 10000000));

Re: Live Scoreboard not working

Posted: Tue Sep 11, 2018 9:14 pm
by NHfootballpool
the update seemed to work for me, thanks for posting

Re: Live Scoreboard not working

Posted: Wed Sep 12, 2018 1:34 pm
by kingmullet
I made all the changes, but not getting the updated scores

Re: Live Scoreboard not working

Posted: Wed Sep 12, 2018 5:57 pm
by Smokey Jones
GiantsFan wrote: Tue Sep 11, 2018 10:49 am I believe I figured this out..
You, Sir, are AWESOME!!!! Thanks for figuring this out!!

Re: Live Scoreboard not working

Posted: Wed Sep 12, 2018 9:14 pm
by mspslb
Changes worked well for me. Thanks for the assist!

Re: Live Scoreboard not working

Posted: Thu Sep 13, 2018 8:31 pm
by Stutgrtguy
GiantsFan wrote: Tue Sep 11, 2018 10:49 am I believe I figured this out.. need to add one new line to common.asp to get the current week from the pool, and change 3 lines in scoreboard.js to change to the new URL and append the week value. I've made a lot of custom changes to my code, so i can't go with line numbers. Hopefully by providing old and new, that should be enough.

Note: This might break during postseason since I'm not sure how the week number will be formatted, so this might be revisited in January.

includes/common.asp
Old

Code: Select all

if ENABLE_SCORES_ADDON then
	Response.Write(vbTab & "<script type=""text/javascript"" src=""scripts/scoreboard.js""></script>" & vbCrLf)
end if
New

Code: Select all

if ENABLE_SCORES_ADDON then
	Response.Write(vbTab & "<script type=""text/javascript"">var currentSBWeek =" & getCurrentWeek() & ";</script>" & vbCrLf) 
	Response.Write(vbTab & "<script type=""text/javascript"" src=""scripts/scoreboard.js""></script>" & vbCrLf)
end if
scripts/scoreboard.js
Old

Code: Select all

var isPlayoffs = false;
var scoresUrl = "http://www.nfl.com/liveupdate/scorestrip/ss.xml";
if (isPlayoffs)
	scoresUrl = "http://www.nfl.com/liveupdate/scorestrip/postseason/ss.xml";
New

Code: Select all

var isPlayoffs = false;
var scoresUrl = "http://www.nfl.com/ajax/scorestrip?season=2018&seasonType=REG&week=" + currentSBWeek;
if (isPlayoffs)
	scoresUrl = "http://www.nfl.com/ajax/scorestrip?season=2018&seasonType=POST&week=" + currentSBWeek;
Old

Code: Select all

xhr.queryString = "url=" + escape(scoresUrl + "?random=" + Math.floor(Math.random() * 10000000));
New

Code: Select all

xhr.queryString = "url=" + escape(scoresUrl + "&random=" + Math.floor(Math.random() * 10000000));
WORKED!
Thanks!

Re: Live Scoreboard not working

Posted: Sat Sep 15, 2018 5:55 am
by jhronesz
Works for me. Thank you!!!!!!

Re: Live Scoreboard not working

Posted: Sun Sep 16, 2018 4:31 pm
by chuckie365
Is it working now for everyone?...mine isn't updating scores on Sunday. Thanks!

Re: Live Scoreboard not working

Posted: Sun Sep 16, 2018 4:36 pm
by mspslb
Anyone have their Help/Rules pages stop working after implementing this change? I can go back and forth with only changing common.asp code and always get the same results. If I comment out the new lines and uncomment the old, it works. If I comment out the old and uncomment the new, it breaks. Doesn't matter which version of the scoreboard.js file that is active. I have been digging through this all day and can't find what in the helpRules.asp page is blowing up.

Re: Live Scoreboard not working

Posted: Sun Sep 16, 2018 4:38 pm
by mspslb
@Chuckie365 - having that issue as well. Games show up correctly, but no scores since the THursday night game.

Re: Live Scoreboard not working

Posted: Sun Sep 16, 2018 5:10 pm
by mspslb
After turning my attention to the new feed not getting updates, I found that the file was not being updated today - no issue with the pool site/code. Checking further, I found that the original link was now working again. I have reverted all of the changes for now. Both the pool rules and the live scoreboard are working at this point.

Re: Live Scoreboard not working

Posted: Mon Sep 17, 2018 2:56 pm
by Smokey Jones
mspslb wrote: Sun Sep 16, 2018 5:10 pm I have reverted all of the changes for now. Both the pool rules and the live scoreboard are working at this point.
I reverted as well and all is working as it did last season. While the updated code above resolved the issue, the link that it uses doesn't provide a live game feed, therefore scores weren't updating at regular intervals.

Re: Live Scoreboard not working

Posted: Thu Sep 20, 2018 3:40 pm
by Stutgrtguy
mspslb wrote: Sun Sep 16, 2018 4:36 pm Anyone have their Help/Rules pages stop working after implementing this change? I can go back and forth with only changing common.asp code and always get the same results. If I comment out the new lines and uncomment the old, it works. If I comment out the old and uncomment the new, it breaks. Doesn't matter which version of the scoreboard.js file that is active. I have been digging through this all day and can't find what in the helpRules.asp page is blowing up.
Yep ran into this as well, I reverted, back and oddly enough the scoreboard started working? I'm at a loss....strange

Re: Live Scoreboard not working

Posted: Thu Nov 01, 2018 8:09 pm
by Russaholic
I didn't have the same luck when reverting back. Let me know if someone is able to find a fix because the scoreboard isn't worth much if it isn't live.

Re: Live Scoreboard not working

Posted: Sat Aug 17, 2019 4:49 pm
by fbonani
I've been trying to figure out how the live scoreboard works. I know that it depends on the scoreboard.js file in the scripts folder and the scoreboard.css file in the styles folder, but what triggers the scoreboard to show. Which file actually generates the scoreboard.

Re: Live Scoreboard not working

Posted: Fri Sep 13, 2019 8:29 pm
by Russaholic
Fbonani,

You can turn the scoreboard on/off in the includes/config.asp file around line 243.

Code: Select all

'Enable live scoreboard and scores loader flag.
const ENABLE_SCORES_ADDON = true

Re: Live Scoreboard not working

Posted: Fri Sep 13, 2019 8:45 pm
by fbonani
Thanks, it took me a while but I finally figured out that needed to be turned on in order for the autoscore to work. I should have posted that the problem had been resolved. My apologies.

Re: Live Scoreboard not working

Posted: Thu Aug 20, 2020 10:18 am
by goose
Does anyone have the new url for scores? Looks like the old one stopped working.

Re: Live Scoreboard not working

Posted: Thu Aug 20, 2020 3:14 pm
by Stutgrtguy
Holy freakin crap on a crispy cringle cut french fry....I so hate 2020....its the gift that keeps on giving.

I hadnt noticed till you pointed it out....

Im sorry I don't, just one more thing to look into this year

Re: Live Scoreboard not working

Posted: Wed Sep 09, 2020 4:02 pm
by Stutgrtguy
You all realise what this means right? I may be wrong but I'm thinkin we will have to input scores manually...