Live Scoreboard not working

Post here to discuss topics relate to the 4.x version for the ASP Football Pool software program. All support topics should go here.
User avatar
Russaholic
Posts: 58
Joined: Tue Oct 15, 2013 3:19 pm
Contact:

Re: Live Scoreboard not working

Post by Russaholic »

You're not kidding, Stutgrtguy. What, are we animals now!? haha. I plan on diving into this deeper once I get settled into the season. I briefly read up on json and API, so hopefully we can find what the new NFL pathway is or even a new, more consistent source.
baldy51497
Posts: 7
Joined: Tue Sep 11, 2018 7:50 am

Re: Live Scoreboard not working

Post by baldy51497 »

I found this change in the xml url. It only seemed to fix the Update Scores page but not the Live Scoreboard.

http://static.nfl.com/liveupdate/scorestrip/ss.xml
User avatar
Russaholic
Posts: 58
Joined: Tue Oct 15, 2013 3:19 pm
Contact:

Re: Live Scoreboard not working

Post by Russaholic »

Great find baldy51497! Once I updated the URLs and cleared my browser's cache, the Live Scoreboard worked as advertised.

For those who don't want to go back and look where to update the link, here you go.

Update file: scripts/scoreboard.js

Go to line 17 thru 21, change to the following:

Code: Select all

  // Determine the correct URL to use for retrieving scoreboard data.
  var isPlayoffs = false;
  var scoresUrl = "http://static.nfl.com/liveupdate/scorestrip/ss.xml";
  if (isPlayoffs)
  scoresUrl = "http://static.nfl.com/liveupdate/scorestrip/postseason/ss.xml";
Be sure to clear your browser's cache to make sure the update takes.
chuckie365
Posts: 14
Joined: Fri Jun 19, 2015 8:58 pm

Re: Live Scoreboard not working

Post by chuckie365 »

Does this fix the auto update scores feature as well? I have a live scoreboard now but when I click on auto update I just get the green moving bars without anything updating. Thanks!
User avatar
Stutgrtguy
Posts: 167
Joined: Sun Oct 20, 2013 3:54 pm
Location: Colorado

Re: Live Scoreboard not working

Post by Stutgrtguy »

Been playin around with this all morning, even uploaded the original updatescores.asp file and set the year to 2020, auto update scores still not working.

Anyone know how to fix the "updatescores.asp"?

Nvm figured it out.

correct code in update scores.asp

Code: Select all

//---------------------------------------------------------------------
// Parses the scores page and updates the form with any new game
// results.
//---------------------------------------------------------------------
function processXMLScores() {

var vid, hid, vscore, hscore;
var s, ot
var el, el2;
var vn, hn;

var formWeek = formEl.elements["week"].value;

var xmlURL = "http://static.nfl.com/liveupdate/scorestrip/ss.xml"
chuckie365
Posts: 14
Joined: Fri Jun 19, 2015 8:58 pm

Re: Live Scoreboard not working

Post by chuckie365 »

I'm still having problems...should the overall code look like this?

Code: Select all

// Parses the scores page and updates the form with any new game
// results.
//---------------------------------------------------------------------
function processXMLScores() {

var vid, hid, vscore, hscore;
var s, ot
var el, el2;
var vn, hn;

var formWeek = formEl.elements["week"].value;

var xmlURL = "http://static.nfl.com/liveupdate/scorestrip/ss.xml"
		

			// Get the document loaded in the iframe.
			var doc = scoresIframe.scoresDoc;

			// Get the document loaded in the iframe.
			var doc = scoresIframe.scoresDoc;
User avatar
Stutgrtguy
Posts: 167
Joined: Sun Oct 20, 2013 3:54 pm
Location: Colorado

Re: Live Scoreboard not working

Post by Stutgrtguy »

we modified this file a year or 2 back, and I don't remember everything we did so I'll upload my working "updatescores.asp" file



updatescores.zip
chuckie365
Posts: 14
Joined: Fri Jun 19, 2015 8:58 pm

Re: Live Scoreboard not working

Post by chuckie365 »

Thank you very much sir. That resolved it!
RickAlex
Posts: 11
Joined: Wed Aug 28, 2013 11:13 am

Re: Live Scoreboard not working

Post by RickAlex »

I have faith we can figure it out. I have some free time tomorrow to dig into this...
User avatar
Russaholic
Posts: 58
Joined: Tue Oct 15, 2013 3:19 pm
Contact:

Re: Live Scoreboard not working

Post by Russaholic »

I am unable to get the scores to load or auto-update to work still. On Chrome, I get the continuous 'Loading' spinning wheel, and on Safari I get the 'Load Complete' - 'No Results Available...' notice.

I have updated line 149 to:
var xmlURL = "http://static.nfl.com/liveupdate/scorestrip/ss.xml"

I even updated the following links to their new pathways:
XML link: http://static.nfl.com/ajax/scorestrip?s ... REG&week=1
Line 164:
var xmlURL = "http://static.nfl.com/ajax/scorestrip?season=" + currentYear + "&seasonType=REG&week="+formWeek;
JSON Link: http://static.nfl.com/liveupdate/scores/scores.json
Line 258:
var mydata = getDataFeed("http://static.nfl.com/liveupdate/scores/scores.json")

At this point, I am not confident the issue is on our end. I was reading that the NFL is having tech issues on their side with game scoring and updates. Time will tell I suppose.
solk33
Posts: 2
Joined: Mon Sep 14, 2020 2:44 pm

Re: Live Scoreboard not working

Post by solk33 »

Russaholic wrote: Mon Sep 14, 2020 12:54 pm I am unable to get the scores to load or auto-update to work still. On Chrome, I get the continuous 'Loading' spinning wheel, and on Safari I get the 'Load Complete' - 'No Results Available...' notice.

I have updated line 149 to:
var xmlURL = "http://static.nfl.com/liveupdate/scorestrip/ss.xml"

I even updated the following links to their new pathways:
XML link: http://static.nfl.com/ajax/scorestrip?s ... REG&week=1
Line 164:
var xmlURL = "http://static.nfl.com/ajax/scorestrip?season=" + currentYear + "&seasonType=REG&week="+formWeek;
JSON Link: http://static.nfl.com/liveupdate/scores/scores.json
Line 258:
var mydata = getDataFeed("http://static.nfl.com/liveupdate/scores/scores.json")

At this point, I am not confident the issue is on our end. I was reading that the NFL is having tech issues on their side with game scoring and updates. Time will tell I suppose.
I made these same changes with the file that was linked by Stutgrtguy yesterday. The live scoreboard was working for me only after I cleared my browser cache. However I still can not the the auto-update to work. If I check it it just spins endlessly (Chrome and Edge) and if I just click the manual Load button it comes back with update successful but doesn't fill in any scores.
User avatar
Stutgrtguy
Posts: 167
Joined: Sun Oct 20, 2013 3:54 pm
Location: Colorado

Re: Live Scoreboard not working

Post by Stutgrtguy »

Russ did you DL my working file?

Also you have to change the scoreboard script file and clean the cache.


I agree, some of the scores that were finals still showed as 2nd quarter, very odd. NFL is doin us some pranks

Chrome won't tmeout, as much as ive tried, I cant even cancel,

Thank you Russaholic for doin some legwork...
User avatar
Stutgrtguy
Posts: 167
Joined: Sun Oct 20, 2013 3:54 pm
Location: Colorado

Re: Live Scoreboard not working

Post by Stutgrtguy »

If ya'll don't trust DL I'll post the workin code here for copy n paste

updatescores.asp

Code: Select all

<%@ LANGUAGE="VBScript" %>
<!-- #include file="includes/config.asp" --><!-- #include file="includes/common.asp" --><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!-- #include file="includes/email.asp" -->
<!-- #include file="includes/encryption.asp" -->
<!-- #include file="includes/form.asp" -->
<!-- #include file="includes/side.asp" -->
<!-- #include file="includes/weekly.asp" -->
<%	'Limit access to the Administrator.
	call CheckAccess(true)

	'Open the database.
	call OpenDb() %>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<%	PageSubTitle = "Enter Game Scores"
	if not ENABLE_SCORES_ADDON then
		call BuildPageHeader("", "")
	else
		call BuildPageHeader("loadDialogs.css", "") %>
	<script type="text/javascript">//<![CDATA[

//=========================================================================
// Module: scoresLoader
//
// Used to set game scores using data retrieved from the NFL.com web site.
//=========================================================================
var scoresLoader = function () {

// The update form.
var formEl = null;

// The week to update.
var week = "";

// Define an array to hold form field information for each game listed
// on the form.
var gameFields = [];

// Auto-update parameters.
var autoUpdate = false;
var autoUpdateLoadTimeoutID = null;
// MSP 10/22/18 Comment out first line and comment 2nd, will check every 10 seconds for testing
//var autoUpdateLoadTimeout = 10000; // 10 seconds.
var autoUpdateLoadTimeout = 300000; // 5 minutes.
var autoUpdateDialogTimeout = 500; // one half second.

// Holds the data parsed from the scores page.
var gameData = null;

// Used for dialog messages.
var resultMsg = "";
var errorMsg = "";
var foundNewResults = false;

//---------------------------------------------------------------------
// Initializes the scores loader.
//---------------------------------------------------------------------
function init() {

// Get the scores update form.
formEl = document.getElementById("scoresForm");

// Get the week.
week = formEl.elements["week"].value;

// Scan the form and build the games fields array.
var i = 1;
var el;
while ((el = formEl.elements["id-" + i]) != null) {
var vid = formEl.elements["vid-" + i].value;
var hid = formEl.elements["hid-" + i].value;
var vscoreEl = formEl.elements["vscore-" + i];
var hscoreEl = formEl.elements["hscore-" + i];
var otEl = formEl.elements["ot-" + i];
gameFields.push({
"visitorID" : vid,
"visitorScoreEl" : vscoreEl,
"homeID" : hid,
"homeScoreEl" : hscoreEl,
"overtimeEl" : otEl
});
i++;
}

// If auto-update is checked, start it.
autoUpdate = formEl.elements["autoUpdate"].checked;
if (autoUpdate)
autoUpdateLoadTimeoutID = setTimeout(getScores, autoUpdateLoadTimeout);
}

//---------------------------------------------------------------------
// Initiates the retrieval of game results.
//---------------------------------------------------------------------
function getScores() {

// Clear any existing game data.
gameData = [];

// Clear any highlighting on the form fields.
for (var i = 0; i < gameFields.length; i++) {
domUtils.removeClass(gameFields[i].visitorScoreEl,        "fieldLoaded");
domUtils.removeClass(gameFields[i].homeScoreEl,           "fieldLoaded");
domUtils.removeClass(gameFields[i].overtimeEl.parentNode, "fieldLoaded");
}

// Initialize the display.
foundNewResults = false;
showLoadingDisplay("loadingActive");

processXMLScores();

return false;
}


//---------------------------------------------------------------------
// Get NFL Data Feeds.
//---------------------------------------------------------------------
function getDataFeed(url) {
var resp ;
var xmlHttp ;

resp = '' ;
xmlHttp = new XMLHttpRequest();

if(xmlHttp != null)
{
xmlHttp.open( "GET", url, false );
xmlHttp.send( null );
resp = xmlHttp.responseText;
}
return resp ;
}


//---------------------------------------------------------------------
// Parses the scores page and updates the form with any new game
// results.
//---------------------------------------------------------------------
function processXMLScores() {

var vid, hid, vscore, hscore;
var s, ot
var el, el2;
var vn, hn;

var formWeek = formEl.elements["week"].value;

var xmlURL = "http://static.nfl.com/liveupdate/scorestrip/ss.xml"
var myData = getDataFeed(xmlURL);
var parser = new DOMParser();
var xmlDoc = parser.parseFromString(myData, "text/xml");

var gameEls = xmlDoc.getElementsByTagName("gms");
if (gameEls.length > 0) {
var xmlWeek = gameEls[0].getAttribute("w");
var xmlYear = gameEls[0].getAttribute("y");
var xmlType = gameEls[0].getAttribute("t");
}	

if (formWeek != xmlWeek) {
// var xmlURL = "http://www.nfl.com/ajax/scorestrip?season=2018&seasonType=REG&week="+formWeek;
var currentYear = new Date().getFullYear();
var xmlURL = "http://www.nfl.com/ajax/scorestrip?season=" + currentYear + "&seasonType=REG&week="+formWeek;
var myData = getDataFeed(xmlURL);
var parser = new DOMParser();
var xmlDoc = parser.parseFromString(myData, "text/xml");
}


			var gameEls = xmlDoc.getElementsByTagName("g");
			for (var i = 0; i < gameEls.length; i++) {
				ot 	= false;
				s	= gameEls[i].getAttribute("q");
				if ((s != null) && ((s.trim().toLowerCase() == "f") || (s.trim().toLowerCase() == "fo"))) {	
					vid 	= gameEls[i].getAttribute("v");
					vscore 	= gameEls[i].getAttribute("vs");
					hid 	= gameEls[i].getAttribute("h");
					hscore 	= gameEls[i].getAttribute("hs");
					if (s.trim().toLowerCase() == "fo") {
						ot = true;
					}
					// Fix team IDs.
					if (vid == "JAC")
						vid = "JAX";
					if (hid == "JAC")
						hid = "JAX";
						
					// Save the results.
					gameData.push({
						"visitorID"    : vid,
						"visitorScore" : vscore,
						"homeID"       : hid, 
						"homeScore"    : hscore,
						"overtime"     : ot
					});						
				}	
			}
			


// Copy any new results to the appropriate form fields and reset
// the display.
setGameFields();

if (foundNewResults) {
hideLoadingDisplay();

// If auto-update is on, submit the form to update the scores.
if (autoUpdate) {

// Add a new submit button to the form and click it to
// perform the update.
var inputEl = document.createElement("INPUT");
inputEl.name = "submit";
inputEl.type = "submit";
inputEl.value = "Update";
inputEl = formEl.appendChild(inputEl);
inputEl.click();
}
}
else {
showLoadingDisplay("loadingComplete");

// Handle auto-update.
if (autoUpdate) {
setTimeout(hideLoadingDisplay, autoUpdateDialogTimeout);

// Determine if any scores are still missing.
var missingScores = false;
for (i = 0; i < gameFields.length && !missingScores; i++)
if (gameFields[i].visitorScoreEl.value == "" || gameFields[i].homeScoreEl.value == "")
missingScores = true;

// If there are missing scores, set for the next attempt.
// Otherwise off turn auto-update.
if (missingScores)
autoUpdateLoadTimeoutID = setTimeout(getScores, autoUpdateLoadTimeout);
else
stopAutoUpdate();
}
}
}	


//---------------------------------------------------------------------
// Grabs the scores from the NFL JSON feed
// Does not allow for Year / Season / Week selection.
// Only returns "Current" week info
//---------------------------------------------------------------------
function processJSONScores() {

var vid, hid, vscore, hscore;
var s, ot
var el, el2;
var vn, hn;

var mydata = getDataFeed("http://www.nfl.com/liveupdate/scorestrip/ss.json")
var jsonData = JSON.parse(mydata);

for (var i = 0; i < jsonData.gms.length; i++) {
var counter = jsonData.gms[i];
ot = false;
s = (counter.q);
if ((s != null) && ((s.trim().toLowerCase() == "f") || (s.trim().toLowerCase() == "f ot"))) {
vid = (counter.v);
vscore	= (counter.vs);
hid = (counter.h);
hscore	= (counter.hs);
if (s.trim().toLowerCase() == "f ot") {
ot = true;
}

// Fix team IDs.
if (vid == "JAC")
vid = "JAX";
if (hid == "JAC")
hid = "JAX";

// Save the results.
gameData.push({
"visitorID" : vid,
"visitorScore" : vscore,
"homeID" : hid, 
"homeScore" : hscore,
"overtime" : ot
});
}
}

// Copy any new results to the appropriate form fields and reset
// the display.
setGameFields();

if (foundNewResults) {
hideLoadingDisplay();

// If auto-update is on, submit the form to update the scores.
if (autoUpdate) {

// Add a new submit button to the form and click it to
// perform the update.
var inputEl = document.createElement("INPUT");
inputEl.name = "submit";
inputEl.type = "submit";
inputEl.value = "Update";
inputEl = formEl.appendChild(inputEl);
inputEl.click();
}
}
else {
showLoadingDisplay("loadingComplete");

// Handle auto-update.
if (autoUpdate) {
setTimeout(hideLoadingDisplay, autoUpdateDialogTimeout);

// Determine if any scores are still missing.
var missingScores = false;
for (i = 0; i < gameFields.length && !missingScores; i++)
if (gameFields[i].visitorScoreEl.value == "" || gameFields[i].homeScoreEl.value == "")
missingScores = true;

// If there are missing scores, set for the next attempt.
// Otherwise off turn auto-update.
if (missingScores)
autoUpdateLoadTimeoutID = setTimeout(getScores, autoUpdateLoadTimeout);
else
stopAutoUpdate();
}
}
}


//---------------------------------------------------------------------
// Given an element, finds the first occurrence of the given tag with
// the given class name in its descendants.
//---------------------------------------------------------------------
function getFirstSubTagWithClass(el, tName, cName) {

if (el != null) {
var elList = el.getElementsByTagName(tName);
for (var i = 0; i < elList.length; i++)
if (domUtils.hasClass(elList[i], cName))
return elList[i];
}

return null;
}

//---------------------------------------------------------------------
// Given an element, finds the first occurrence of the given tag in
// its descendants.
//---------------------------------------------------------------------
function getFirstSubTag(el, tName) {

if (el != null) {
var elList = el.getElementsByTagName(tName);
if (elList.length > 0)
return elList[0];
}

return null;
}

//---------------------------------------------------------------------
// Given a url, returns the value assigned to the given query string
// parameter.
//---------------------------------------------------------------------
function getQueryStringParameter(qs, pName) {

var re = new RegExp( "[?&]" + pName + "=([^&$]*)", "i" );
var offset = qs.search(re);
if (offset == -1)
return "";

return RegExp.$1;
}

//---------------------------------------------------------------------
// Takes the parsed game results and updates the appropriate form
// fields.
//---------------------------------------------------------------------
function setGameFields() {

// For each game result found, find a matching set of form fields
// to load the data into.
if (gameData.length > 0) {
resultMsg = "All game results are up to date.";
for (var i = 0; i < gameFields.length; i++)
for (var j = 0; j < gameData.length; j++)

// Check if the teams match.
if (gameFields[i].visitorID == gameData[j].visitorID && gameFields[i].homeID == gameData[j].homeID)
{
// Set the individual form fields.
setFormField(gameFields[i].visitorScoreEl, gameData[j].visitorScore);
setFormField(gameFields[i].homeScoreEl, gameData[j].homeScore);
setFormField(gameFields[i].overtimeEl, gameData[j].overtime);
break;
}
}
else
resultMsg = "No results available, try again later.";
}

//---------------------------------------------------------------------
// Updates a single form field with the given value (if that value is
// different from the field's current value).
//---------------------------------------------------------------------
function setFormField(fieldEl, newValue) {

// Compare the old and new values.
var oldValue = fieldEl.value;
if (fieldEl.type == "checkbox")
oldValue = fieldEl.checked;

// If the values are the same, exit.
if (oldValue == newValue)
return;

// Set the form field value and highlight it.
if (fieldEl.type == "checkbox") {
fieldEl.checked = newValue;
domUtils.addClass(fieldEl.parentNode, "fieldLoaded");
}
else {
fieldEl.value = newValue;
domUtils.addClass(fieldEl, "fieldLoaded");
}

// Note that we have new results.
foundNewResults = true;
}

//---------------------------------------------------------------------
// Shows the loading display with the specified message box.
//---------------------------------------------------------------------
function showLoadingDisplay(id) {

// Hide all the message boxes.
document.getElementById("loadingActive").style.display = "none";
document.getElementById("loadingComplete").style.display = "none";
document.getElementById("loadingError").style.display = "none";

// Set the result and error messages.
var el = document.getElementById("loadingResultMsg");
while (el.firstChild != null)
el.removeChild(el.firstChild);
document.getElementById("loadingResultMsg").appendChild(document.createTextNode(resultMsg));
var el = document.getElementById("loadingErrorMsg");
while (el.firstChild != null)
el.removeChild(el.firstChild);
document.getElementById("loadingErrorMsg").appendChild(document.createTextNode(errorMsg));

// Show the specified message box.
el = document.getElementById(id);
if (el != null)
el.style.display = "";

// Make it visible.
document.getElementById("loadingDisplay").style.visibility = "visible";
}

//---------------------------------------------------------------------
// Hides the loading display.
//---------------------------------------------------------------------
function hideLoadingDisplay() {

document.getElementById("loadingDisplay").style.visibility = "hidden";
}

//---------------------------------------------------------------------
// Turns auto-update off.
//---------------------------------------------------------------------
function stopAutoUpdate() {

// Cancel any pending attempt.
if (autoUpdateLoadTimeoutID != null) {
clearTimeout(autoUpdateLoadTimeoutID);
autoUpdateLoadTimeoutID = null;
}

// Set the flag to false and clear the checkbox.
autoUpdate = false;
formEl.elements["autoUpdate"].checked = false;
}

//=====================================================================
// Initialization code.
//=====================================================================

// Initialize on page load.
domUtils.onready(init);

//=====================================================================
// Public properties and methods.
//=====================================================================
return {

//-----------------------------------------------------------------
// Loads game scores for the given week.
//-----------------------------------------------------------------
load : function () {

// Turn off auto-update, if it is on.
if (autoUpdate)
stopAutoUpdate();

getScores();
return false;
},

//-----------------------------------------------------------------
// Cancels a load.
//-----------------------------------------------------------------
cancel : function () {

getScoresCleanUp();
hideLoadingDisplay();

// If auto-update is on, turn it off.
if (autoUpdate)
stopAutoUpdate();

return false;
},

//-----------------------------------------------------------------
// Closes the load display.
//-----------------------------------------------------------------
close : function () {

hideLoadingDisplay();
return false;
},

//-----------------------------------------------------------------
// Toggles auto-update.
//-----------------------------------------------------------------
toggleAutoUpdate : function () {

// If auto-update is on, turn it off. Otherwise, turn it on and
// make an attempt.
if (autoUpdate)
stopAutoUpdate();
else {
autoUpdate = true;
getScores();
}

// Allow the check box to change.
return true;
}
}
}();
//]]></script>
<%	end if %>
<!-- #include file="includes/custom.asp" -->
</head>
<body>
<!-- #include file="includes/header.asp" -->
<!-- #include file="includes/menu.asp" -->
	<div id="contentSection">
	<table id="mainWrapper" border="0" cellpadding="0" cellspacing="0"><tr><td>
<%	'Get the week to display.
	dim week
	week = GetRequestedWeek()

	'If there is form data, process it.
	dim n, i
	dim gameID, vscore, hscore, ot
	dim notify, infoMsg
	dim sql, rs
	n = GetGameCount(week)
	if Request.ServerVariables("Content_Length") > 0 and not IsCancelRequest() then
		for i = 1 to n

			'Get the form fields.
			gameID = Trim(Request.Form("id-"     & i))
			vscore = Trim(Request.Form("vscore-" & i))
			hscore = Trim(Request.Form("hscore-" & i))
			ot     = Trim(Request.Form("ot-"     & i))

			'Validate the form fields.
			if vscore <> "" or hscore <> "" or ot <> "" then
				if not IsValidInteger(vscore) then
					FormFieldErrors.Add "vscore-" & i, "'" & vscore & "' is not a valid game score."
				else
					if CInt(vscore) < 0 then
						FormFieldErrors.Add "vscore-" & i, "'" & vscore & "' is not a valid game score."
					end if
				end if
				if not IsValidInteger(hscore) then
					FormFieldErrors.Add "hscore-" & i, "'" & hscore & "' is not a valid game score."
				else
					if CInt(hscore) < 0 then
						FormFieldErrors.Add "hscore-" & i, "'" & hscore & "' is not a valid game score."
					end if
				end if
			end if
		next

		'If there were any errors, display the error summary message.
		'Otherwise, do the updates.
		if FormFieldErrors.Count > 0 then
			call DisplayFormFieldErrorsMessage("Error: Invalid fields. Please correct and resubmit.")
		else
			for i = 1 to n
				gameID = Trim(Request.Form("id-"    & i))
				vscore = Trim(Request.Form("vscore-" & i))
				hscore = Trim(Request.Form("hscore-" & i))
				ot     = Trim(Request.Form("ot-"     & i))
				if LCase(ot) <> "true" then
					ot = false
				end if

				'Update the scores.
				if vscore = "" then
					vscore ="NULL"
				end if
				if hscore = "" then
					hscore ="NULL"
				end if
				sql = "UPDATE Schedule SET" _
				   & " VisitorScore = " & vscore & "," _
				   & " HomeScore    = " & hscore & "," _
				   & " OT           = " & ot _
				   & " WHERE GameID = " & gameID
				call DbConn.Execute(sql)

				'Update the results.
				call SetGameResults(gameID)

			next

			'Clear any cached pool results.
			call ClearWeeklyResultsCache(week)
			if ENABLE_MARGIN_POOL then
				call ClearMarginResultsCache(week)
			end if
			if ENABLE_SURVIVOR_POOL then
				call ClearSurvivorStatus(week)
			end if

			'Send out email notifications, if checked.
			infoMsg = "Update successful."
			notify = Trim(Request.Form("notify"))
			if LCase(notify) = "true" then
				infoMsg = "Update successful, notifications sent."
				call SendNotifications()
			end if

			'Updates done, show an informational message.
			call DisplaySuccessMessage(infoMsg)
		end if
	end if

	'Display the schedule for the specified week.
	dim cols
	cols = 9
	if USE_POINT_SPREADS then
		cols = cols + 1
	end if %>
	<form id="scoresForm" action="<% = Request.ServerVariables("SCRIPT_NAME") %>" method="post">
		<div><input type="hidden" name="week" value="<% = week %>" /></div>
		<table border="0" cellpadding="0" cellspacing="0"><tr><td style="padding: 0px;">
		<table class="main" border="0" cellpadding="0" cellspacing="0">
			<tr class="header bottomEdge">
			  <th align="left" colspan="<% = cols %>">Week <% = week %></th>
			</tr>
<%	if ENABLE_SCORES_ADDON then
		dim autoUpdate, missingScores
		autoUpdate    = false
		missingScores = false
	end if

	dim gameDate, gameTime, vid, hid
	dim visitor, home, result, checkedStr
	dim spread, atsResult
	dim alt
	set rs = GetGamesRecordset(week)
	if not (rs.EOF and rs.BOF) then
		n = 1
		alt = false
		do while not rs.EOF
			gameID    = rs.Fields("GameID").Value
			gameDate  = rs.Fields("Date").Value
			gameTime  = rs.Fields("Time").Value
			vid       = rs.Fields("VisitorID").Value
			vscore    = rs.Fields("VisitorScore").Value
			spread    = rs.Fields("PointSpread").Value
			hid       = rs.Fields("HomeID").Value
			hscore    = rs.Fields("HomeScore").Value
			ot        = rs.Fields("OT").Value
			result    = rs.Fields("Result").Value
			atsResult = rs.Fields("ATSResult").Value
			visitor   = rs.Fields("VCity").Value
			home      = rs.Fields("HCity").Value

			if ENABLE_SCORES_ADDON then
				if IsNull(vscore) or IsNull(hscore) then
					missingScores = true
				end if
			end if

			'Set the team names for display.
			if rs.Fields("VDisplayName").Value <> "" then
				visitor = rs.Fields("VDisplayName").Value
			end if
			if rs.Fields("HDisplayName").Value <> "" then
				home = rs.Fields("HDisplayName").Value
			end if

			'Highlight the results.
			if result = vid then
				visitor = FormatWinner(visitor)
			elseif result = hid then
				home = FormatWinner(home)
			end if
			if atsResult = vid then
				visitor = FormatATSWinner(visitor)
			elseif atsResult = hid then
				home = FormatATSWinner(home)
			end if

			'If there were errors on the form post processing, restore those fields.
			if FormFieldErrors.Count > 0 then
				vscore = GetFieldValue("vscore-" & n, vscore)
				hscore = GetFieldValue("hscore-" & n, hscore)
				ot     = FormFieldExists("ot-" & n)
			end if

			'Set the OT checkbox state.
			checkedStr = ""
			if ot then
				checkedStr = CHECKED_ATTRIBUTE
			end if

			if alt then %>
			<tr align="right" class="alt">
<%			else %>
			<tr align="right">
<%			end if
			alt = not alt %>
<%				if ENABLE_SCORES_ADDON then %>
				<td><input type="hidden" name="id-<% = n %>" value="<% = gameID %>" /><input type="hidden" name="vid-<% = n %>" value="<% = vid %>" /><input type="hidden" name="hid-<% = n %>" value="<% = hid %>" /><% = WeekdayName(Weekday(gameDate), true) %></td>
<%				else %>
				<td><input type="hidden" name="id-<% = n %>" value="<% = gameID %>" /><% = WeekdayName(Weekday(gameDate), true) %></td>
<%				end if %>
				<td><% = FormatDate(gameDate) %></td>
				<td><% = FormatTime(gameTime) %></td>
				<td align="left"><% call DisplayTeamLogo(vid) %><% = visitor %></td>
				<td><input type="text" name="vscore-<% = n %>" value="<% = vscore %>" size="2" class="<% = StyleFormField("numeric", "vscore-" & n) %>" /></td>
<%			if USE_POINT_SPREADS then %>
				<td><% = FormatPointSpread(spread) %></td>
<%			end if %>
				<td>at</td>
				<td align="left"><% call DisplayTeamLogo(hid) %><% = home %></td>
				<td><input type="text" name="hscore-<% = n %>" value="<% = hscore %>" size="2" class="<% = StyleFormField("numeric", "hscore-" & n) %>" /></td>
				<td><label for="ot-<% = n %>"><span class="small">OT</span></label> <span class="fieldWrapper"><input type="checkbox" id="ot-<% = n %>" name="ot-<% = n %>" value="true"<% = checkedStr %> /></span></td>
			</tr>
<%			rs.MoveNext
			n = n + 1
		loop
		if SERVER_EMAIL_ENABLED then %>
			<tr class="subHeader topEdge">
				<th align="left" colspan="<% = cols %>"><input type="checkbox" id="notify" name="notify" value="true" /> <label for="notify">Send update notification to users.</label></th>
			</tr>
<%		end if %>
		</table>
<%		'List open dates.
		call DisplayOpenDates(week)
	end if

	if ENABLE_SCORES_ADDON then

		'If this was an auto-update post, turn the option on again but only if
		'there are still scores to get.
		autoUpdate = FormFieldExists("autoUpdate")
		if IsCancelRequest() or not missingScores then
			autoUpdate = false
		end if %>
		<p></p>
		<table border="0" cellpadding="0" cellspacing="0" style="width: 100%;">
			<tr valign="middle">
				<td style="padding: 0px;"><input type="submit" id="updateButton" name="submit" value="Update" class="button" />&nbsp;<input type="submit" name="submit" value="Cancel" class="button" /></td>
				<td align="right" style="padding: 0px;"><input type="checkbox" id="autoUpdate" name="autoUpdate" value="true"<% if autoUpdate then Response.Write(" checked=""checked""") end if %> onclick="return scoresLoader.toggleAutoUpdate();" /> <label for="autoUpdate">Auto-update</label>&nbsp;</td>
				<td align="right" style="padding: 0px;"><input type="submit" name="submit" value="Load" class="button" onclick="return scoresLoader.load(<% = week %>);" /></td>
			</tr>
		</table>
<%	else %>
		<p><input type="submit" name="submit" value="Update" class="button" />&nbsp;<input type="submit" name="submit" value="Cancel" class="button" /></p>
<%	end if %>
		</td></tr></table>
	</form>
<%	'List links to view other weeks.
	call DisplayGoToNavigation("week", GetWeekCount(), "") %>
	</td></tr></table>
	</div>
<!-- #include file="includes/footer.asp" -->
<%	if ENABLE_SCORES_ADDON then %>
	<div id="loadingDisplay" style="visibility: hidden;">
 		<div id="loadingDialog">
			<div id="loadingActive">
				<h2><em>Loading...</em></h2>
				<form action="#" method="post" onsubmit="return false;">
					<p><img src="graphics/loading.gif" alt="" /></p>
					<p><input type="submit" name="submit" value="Cancel" class="button" onclick="return scoresLoader.cancel();" /></p>
				</form>
			</div>
			<div id="loadingComplete">
				<h2>Load Complete</h2>
				<form action="#" method="post" onsubmit="return false;">
					<div class="successMsg"><div><span id="loadingResultMsg"></span></div></div>
					<p><input type="submit" name="submit" value="Close" class="button" onclick="return scoresLoader.close();" /></p>
				</form>
			</div>
			<div id="loadingError">
				<h2>Load Failed</h2>
				<form action="#" method="post" onsubmit="return false;">
					<div class="errorMsg"><div><span id="loadingErrorMsg"></span></div></div>
					<p><input type="submit" name="submit" value="Close" class="button" onclick="return scoresLoader.close();" /></p>
				</form>
			</div>
		</div>
	</div>
<%	end if %>

</body>
</html>
<%	'**************************************************************************
	'* Local functions and subroutines.                                       *
	'**************************************************************************

	'--------------------------------------------------------------------------
	' Sends an email notification to any users who have elected to receive
	' them.
	'--------------------------------------------------------------------------
	sub SendNotifications()

		dim subj, body
		dim rs
		dim vscore, hscore
		dim list, email

		subj = "Football Pool Game Results Notification"
		body = "Games results for Week " & week & " have been updated." & vbCrLf & vbCrLf

		'Show results.
		set rs = GetGamesRecordset(week)
		do while not rs.EOF
			vscore = ""
			hscore = ""
			if not IsNull(rs.Fields("Result").Value) then
				vscore = " " & rs.Fields("VisitorScore").Value
				hscore = " " & rs.Fields("HomeScore").Value
			end if
			body = body & rs.Fields("VisitorID").Value & vscore
			if USE_POINT_SPREADS then
				body = body & " (" & GetPlainTextPointSpread(rs.Fields("PointSpread").Value) & ")"
			end if
			body = body & " at " & rs.Fields("HomeID").Value & hscore
			if rs.Fields("OT").Value then
				body = body & " OT"
			end if
			body = body & vbCrLf
			rs.moveNext
		loop

		list = GetNotificationList("NotifyOfResultUpdates")
		for each email in list
			call SendMail(email, subj, body)
		next

	end sub %>
User avatar
Russaholic
Posts: 58
Joined: Tue Oct 15, 2013 3:19 pm
Contact:

Re: Live Scoreboard not working

Post by Russaholic »

Thanks for the help, Stutgrtguy. So far, I am unable to get it sorted out. I am still dealing with the same issues as I reported above.

I have double-checked the scoreboard.js file, went line by line on the updateScores.asp file, and cleared out the cache. I even tried on multiple browsers and computers just to make sure. I also made a fresh updateScore file solely from the code you provided.

I think I just need to leave it alone for a bit and come back when I have fresh eyes and a better attitude. :(
User avatar
Stutgrtguy
Posts: 167
Joined: Sun Oct 20, 2013 3:54 pm
Location: Colorado

Re: Live Scoreboard not working

Post by Stutgrtguy »

Owwie...Im still tryin to figure what could be wrong on your end, as we have it fixed here on Chrome, edge,and even the nasty apples are fine.

I would say an internal issue but if you've tried other pc's/phones....all that comes to mind is cleaning the cache, yet I only did it on my end, everyone else was fine.

Has to be an internal issue, try reloading some fresh files to your server? Clean the cache after....

Do both the autoupdate.asp and the scoreboard.js files.

I'm enclosing both that work for me (as always make backups)

updates.zip
User avatar
Russaholic
Posts: 58
Joined: Tue Oct 15, 2013 3:19 pm
Contact:

Re: Live Scoreboard not working

Post by Russaholic »

Still no luck on my end. I think that the issues may lie within my server, or you just have some real-life magic happening on your end.

Here is what I have done to check everything out.
  • Swapped out all files with your "working" ones - No go
  • Setup an entirely new pool with fresh files and made the scoreboard pathway adjustments - no go
  • Went back through this thread and re-tried all the old fixes just incase - no go
  • Yelled at the computer - no go
I am going to take a pause on this effort for a bit. I've got more hours wasted than it would have taken me to hand-jam three seasons of scores in myself.

Thanks for your help though. Hopefully, I'll have one of those moments of enlightenment and sort it out sooner than later.

-Russ
User avatar
Stutgrtguy
Posts: 167
Joined: Sun Oct 20, 2013 3:54 pm
Location: Colorado

Re: Live Scoreboard not working

Post by Stutgrtguy »

urrrg, this irks me, gotta sleep on it maybe it'll come to me.

one last question..server?

code is good, somethin else is goin on
User avatar
Russaholic
Posts: 58
Joined: Tue Oct 15, 2013 3:19 pm
Contact:

Re: Live Scoreboard not working

Post by Russaholic »

I am currently using InterServer. And I just thought about this, but I have secured my site and added SSL/TLS. I wonder if that may be interfering with the connection to load the scores. However, it doesn't seem all too likely since my scoreboard is performing as advertised.

Also, for anyone looking for a new host, I highly recommend them. They are the 4th different ASP.net friendly service I've used and it is far better than the others. It is the easiest to navigate and the FTP speeds are awesome.
solk33
Posts: 2
Joined: Mon Sep 14, 2020 2:44 pm

Re: Live Scoreboard not working

Post by solk33 »

Russaholic wrote: Sat Sep 19, 2020 10:18 pm I am currently using InterServer. And I just thought about this, but I have secured my site and added SSL/TLS. I wonder if that may be interfering with the connection to load the scores. However, it doesn't seem all too likely since my scoreboard is performing as advertised.
Interesting, I've been having the same issues you have been describing and I just added SSL/TLS to my site this year. I'm on my own Windows Server 2019 VM instance and my scoreboard is working but can't get the scores to auto-update. Still haven't been able to figure it out on my end either.
baldy51497
Posts: 7
Joined: Tue Sep 11, 2018 7:50 am

Re: Live Scoreboard not working

Post by baldy51497 »

The annual question:
Does anyone have the new url for scores? Looks like the old one (http://static.nfl.com/liveupdate/scorestrip/ss.xml) is stuck on the last week of last season.
User avatar
Stutgrtguy
Posts: 167
Joined: Sun Oct 20, 2013 3:54 pm
Location: Colorado

Re: Live Scoreboard not working

Post by Stutgrtguy »

Yep here we go again....I've been unsuccessfully playin with it....I'm glad it's not just me as we finally upgraded to secure (ssl/tls) figured i got the same bug as russ and solk did last year
User avatar
metroman90210
Posts: 16
Joined: Wed Jul 21, 2021 10:36 am

Re: Live Scoreboard not working

Post by metroman90210 »

I've got one on another site that is working pulling the feed from ESPN. Unfortunately it uses php so it would not work here. Perhaps someone can cobble one together using this link to pull from.

Live Scoreboard link
Noradavis
Posts: 1
Joined: Wed Feb 22, 2023 3:04 am
Location: United States
Contact:

Re: Live Scoreboard not working

Post by Noradavis »

Google discover has stopped showing live sports scores. Cleared cache and data on Google app ... But the sports live score updates do not show up.Live Score app may not be working for you due to some issues that clicker counter your device may have or your internet connection problem. If you think that Li Open Settings” to proceed. On the next screen, find “Google” on the list. Toggle the switch to “Allow Display Over Other Apps.” Now you can go back and tap “Pin Live Score” again.You're Not Posting At The Right Times. Early impressions can be achieved on pins, but only when you post your pins at the right time. Posting your pins when your followers are most active is one of the best ways to get your pins noticed early on.
Post Reply