Open GoogleCodeExporter opened 9 years ago
problem reproduced. will look into it.
Original comment by rod...@gmail.com
on 21 Jun 2007 at 5:32
Also, in addition to HR not showing, SB appears not to show as well. Tested it
with
Gary Matthews Jr.
Original comment by enthre...@gmail.com
on 25 Jun 2007 at 7:35
Thanks. It's the same issue: the same function parses the boxscores for SB, 2B,
3B,
HR, HBP, and SF. I'll try to fix it this week if I get a chance.
Original comment by rod...@gmail.com
on 25 Jun 2007 at 2:07
Also happens with B. McCann, since contains() is case sensitive, and Yahoo!
likes to
spell his name as Mccann in the HR section.
Original comment by gopac...@gmail.com
on 28 Aug 2007 at 3:39
Any fix for this?
Original comment by cbas...@gmail.com
on 21 May 2008 at 6:52
Still an issue for last names with multiple upper-case characters. Sample code
below
can be used as a player-specific workaround.
The second and third lines are the workaround; just replace McLouth and/or
DeRosa
with the players on your team(s). I'm not 100% sure SB are still a problem,
but HR
definitely are. This is obviously an unwieldy solution, but it works in the
short term.
function getXBHorSB(type, playerName, document) {
if (type=='HR' && playerName=='N McLouth') {playerName='N Mclouth';}
if (type=='HR' && playerName=='M DeRosa') {playerName='M Derosa';}
var nodes = xpath(document, "//td[@class='yspscores' and contains(.,'" + type
+ "') and contains(.,'" + playerName + "')]");
var j = nodes.snapshotLength;
var numStat = 0;
if (j) {
var statLine = nodes.snapshotItem(j - 1).textContent;
//Remove everything in parentheses since that may create false matches
statLine = statLine.replace(/\([^\)].+?\)/gi,'');
if (statLine.indexOf(playerName) > -1) {
var re = new RegExp(".*(" + playerName + " *\\d?).+", 'gi');
statLine = statLine.replace(re, "$1");
statLine = statLine.replace(/[^\d]+/, '');
numStat = (statLine == '') ? 1 : statLine;
}
}
return numStat;
}
Original comment by ethanher...@gmail.com
on 20 Apr 2009 at 3:25
Original issue reported on code.google.com by
enthre...@gmail.com
on 20 Jun 2007 at 10:00