Yahoo Fantasy Baseball Live Stats

By Dave 3 Last update May 19, 2007 — Installed 18,510 times.

Archived Comments (locked)

in
Subscribe to Archived Comments 53 posts, 24 voices



Jesse Andrews Admin

The following is an archive of comments made before threaded discussions was implemented (November 16th, 2008)

 
Dave 3 Script's Author

I didn't write a script for fantasy football but someone else has: http://userscripts.org/scripts/show/6486

if you're a facebook user, check out http://apps.new.facebook.com/fbfantasy/. there's free live scoring and real time stats.

 
Adam606 User

Do you have a script for fantasy football on yahoo? I really enjoy what you have put togrther for baseball and was wondering if you have the same for football. Thanks again and please let me know.

 
aaron1325714 User

hey glenn i know my question has nothing to do with this script but i couldnt find your email anywhere

so i was wondering if you could create this script except for baseball it is a bench all players without a game script

http://userscripts.org/scripts/show/6716

that is the script link

and here is the actual script

// ==UserScript==
// @name Yahoo Fantasy NBA Bench All
// @namespace http://mattandchristy.net/benchall
// @description Provides a button to bench all players without a game
// @include http://basketball.fantasysports.yahoo.com/nba/*...=*
// @include http://basketball.fantasysports.yahoo.com/nba/*...
// ==/UserScript==
//
// Change log:
// 2006-12-10 Initial version of script; used Yahoo Fantasy NBA Game Log Link
// as a base to start developing

var doBench = function(event) {

var allElements;
var thisElement;
var playerLink = "http://sports.yahoo.com/nba/players/"
var gameLogLink;


allElements = document.evaluate(
"//*[contains(@class, 'player')]/..",
document,
null,
XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,
null);

// burn the first two rows; they are headers, not players
for (var i = 2; i < allElements.snapshotLength; i++) {

thisElement = allElements.snapshotItem(i);

tds = thisElement.getElementsByTagName('td');
nameNode = tds[1];
if(nameNode) {
// td div a textnode value
name = nameNode.firstChild.firstChild.firstChild.nodeValue;

// get the opponent TD's innerHTML; text node won't work because
// the ? for 'no opponent' gets translated to a character =/
opp = tds[3].innerHTML;

if(opp == '?') {

newPosSelectNode = tds[2].firstChild;
// select the 'BN' node for these guys (last option)
newPosSelectNode.selectedIndex = newPosSelectNode.length-1;

GM_log("Benching " + name);
}
}
}

// stop event propagation, if this was a click
if(event) {
event.stopPropagation();
event.preventDefault();
}
}

/* gameLogLink = document.createElement('a'); */
/* gameLogLink.setAttribute("href",thisElement.href + "/gamelog") */
/* //gameLogLink.setAttribute("class","cellindent") */
/* gameLogLink.setAttribute("target","_blank") */
/* gameLogLink.setAttribute("title","game log link") */
/* gameLogLink.innerHTML = "" */
/* thisElement.parentNode.insertBefore(gameLogLink, thisElement.nextSibling.nextSibling); */

var BENCHBUTTON_ID = "bencherButton";
var BENCHBUTTON_TEXT = "[Bench players with no game]";

// create the bench button
var bencher = document.createElement("A");
bencher.addEventListener("click", doBench, true);
bencher.href = "#";
bencher.innerHTML = BENCHBUTTON_TEXT;
bencher.className = 'button';
/* bencher.style.backgroundColor = "#D8D9D5"; */
/* bencher.style.borderTopColor = "#A8A8A8"; */
/* bencher.style.borderBottomColor = "#A8A8A8"; */
/* bencher.style.borderLeftColor = "#A8A8A8"; */
/* bencher.style.borderRightColor = "#A8A8A8"; */
/* bencher.style.borderTopStyle = "outset"; */
/* bencher.style.borderBottomStyle = "outset"; */
/* bencher.style.borderLeftStyle = "outset"; */
/* bencher.style.borderRightStyle = "outset"; */
/* bencher.style.borderTopWidth = "1px"; */
/* bencher.style.borderBottomWidth = "1px"; */
/* bencher.style.borderLeftWidth = "1px"; */
/* bencher.style.borderRightWidth = "1px"; */
bencher.style.paddingTop = "2px";
bencher.style.paddingBottom = "5px";
bencher.style.paddingLeft = "5px";
bencher.style.paddingRight = "5px";
bencher.style.color = "#FFFFFF";
bencher.id = BENCHBUTTON_ID;

// attach the bench button right before the "submit changes" button
// at the bottom of the screen
var buttonBar = document.getElementById('buttonbar');
var inputs = buttonBar.getElementsByTagName('input');
var submitButton = inputs[inputs.length-1]
buttonBar.insertBefore(bencher, submitButton);

i tried to mess around with it a little bit but got no luck

please respond soon

i will post this on a couple other pages to ensure that you get the message

Aaron S

 
Adam606 User

Is there anything I could do to be able to get the free update to update the league standings and maybe even the league full standings page? I think it would be very useful to be able to click on the full standings and watch my progress soar above the rest of the league. Alright maybe not soar but it would be nice to be able to track my progress instead of having to go into each teams page and go back to see if I changed positions in any category. Thanks for your hard work. I love the freebie stats.

 
Dave 3 Script's Author

goldfishes - I haven't worked on that yet.

 
goldfishes User

Hey Dave have you found out a way to make this scoring so that it incorporates the certain stats that your own league uses rather than the standard?

 
DAtaris17 User

I could be mistaken. My computer runs fine with the script, but my friend informed me that he believed some of those things came from installing it. Anyway, thanks for the reply Dave, I guess I was incorrect.

 
Dave 3 Script's Author

DAtaris17, this script doesn't install spyware or tracking cookies. Greasemonkey scripts aren't compiled so anyone can view the source code. For anyone worried about this script, post in the forums or ask a programmer friend to review its safety. No one has to trust my word....but you should cuz I'm an honest guy plus I link to my personal blog and this script has been installed over 8000 times so that ought to count for something.

 
DAtaris17 User

Very useful, but when installed I ended up with spyware and tracking cookies on my computer as a result. I know they came from this because when I got rid of the program and the cookies, they did not return. Is there any reason as to why this is loaded with spyware? The tracking cookies did not affect my computer's performance, but it's not a good idea to have those lurking on your computer.

 
Dave 3 Script's Author

bmooney - email me dave at robobruin.com

 
b_mooney User

any ideas?

 
b_mooney User

dave,

yes, greasemonkey is enabled and right now there's about 7 games going on so i don't understand why the 'show freebie stats' wont show up

 
Dave 3 Script's Author

bmooney,

is greasemonkey on? click on the monkey icon on the lower right hand side taskbar in firefox to enable it.

the 'show freebie stats' link only appears if a game has been completed or is in progress.

 
b_mooney User

for some reason this script will not work for me. i use firefox, i installed greasemonkey and installed the script but the "Launch Stat Tracker" button is still there...any ideas?

 
Dave 3 Script's Author

no updates. maybe in the next week or two. hopefully before ARod comes off the DL.

 
goldfishes User

Any update Dave?

 
Dave 3 Script's Author

hey guys, my goal is to update the script so that it will be smart enough to discover what stats your league uses and then only show those stats. as soon as I have it ready I'll post it here.

 
gnfishin21 User

Dave,

Awesome work! I know nothing about writing scripts, but any chance you could add batter K, BB, & 2B? Better yet, how about adding an option for the user to pick which stats to track? Thanks again.

 
LenR Scriptwright

Cool.
It would be neat to replace the "Get StatTracker" link too (http://us.rd.yahoo.com/evt=50368/*http://baseba... on my page), and better yet, show the stats inline!

 
Haroldm814 User

HI Dave. Thanks for this amazing script it's so helpful! I appreciate the amount of work you put into this, but I was wondering if maybe you could add BB's to the hitters stats? That would be outstanding =]

Thanks again for a wonderful tool!

 
Kojangles User

Hey Dave -

Love the idea, but for some reason it is not working. I still see "Launch Stattracker". Any suggestions? Thanks.

Brad

 
linkin06 User

my league also has total bases and walks as categories. any way to add these?

 
Dave 3 Script's Author

soxnfire - might be tough. but don't let that stop you from trying.

 
soxnfire User

Dave,

Only having a small amount of programming knowledge, if I did my homework, do you think I could customize this for my league? We are in a rotisserie league, and want to have a head to head playoff at the end of the year. So basically, I would need a total box score for the week, adding daily live stats to the teams playing each other.

If it is something that is pretty complex, and you or Rodric could do it, I would recommend trying to pitch it to a fantasy website for some $$$, as I have found there are large numbers of people pining for a roto regular season with H2H playoffs.

Cross
Presentational HTML allowed.
Use <code> for inline code and <pre> for code blocks. Use &lt; and &gt; for literal < and >.
We help break paragraphs and link your links.
or cancel