Greasy Fork is available in English.

Replays On Box Score

dfsdfsdf

  1. // ==UserScript==
  2. // @name Replays On Box Score
  3. // @namespace robs
  4. // @include http://goallineblitz.com/game/game.pl?game_id=*
  5. // @copyright 2009, pabst
  6. // @license (CC) Attribution Share Alike; http://creativecommons.org/licenses/by-sa/3.0/
  7. // @version 09.02.21
  8. // @description dfsdfsdf
  9. // ==/UserScript==
  10.  
  11. window.setTimeout(
  12. function() {
  13. main();
  14. }
  15. , 10);
  16.  
  17. function main() {
  18. var address = window.location.toString()+"&mode=pbp";
  19. getInetPage(address, run);
  20. }
  21.  
  22. function run(address, page) {
  23. var div = document.createElement("div");
  24. div.innerHTML = page.responseText;
  25. //console.log(div.innerHTML);
  26.  
  27. var plays = div.getElementsByClassName("pbp_play_row_scoring");
  28. var box = document.getElementsByClassName("pbp_play_row");
  29.  
  30. var pidx = 0;
  31. for (var i=0; i<box.length; i++) {
  32. pidx = 0;
  33. var btime = box[i].getElementsByClassName("summary_time")[0];
  34. var btext = box[i].getElementsByClassName("summary_play")[0];
  35. for ( ; pidx<plays.length; pidx++) {
  36. var time = plays[pidx].getElementsByClassName("pbp_time_remaining")[0].innerHTML;
  37. var text = plays[pidx].getElementsByClassName("pbp_play")[0].innerHTML;
  38. if ((time == btime.innerHTML) && (text == btext.innerHTML)) {
  39. var replay = plays[pidx].getElementsByClassName("pbp_replay")[0];
  40. if (replay.firstChild.href != null) {
  41. var a = document.createElement("a");
  42. a.href = replay.firstChild.href;
  43. a.innerHTML = "Replay";
  44.  
  45. btext.innerHTML += "&nbsp;(";
  46. btext.appendChild(a);
  47. btext.innerHTML += ")";
  48. }
  49. break;
  50. }
  51. }
  52. }
  53. }
  54.  
  55. function getInetPage(address, func) {
  56. console.log("getInetPage : "+address);
  57. var req = new XMLHttpRequest();
  58. req.open( 'GET', address, true );
  59. req.onload = function() {
  60. if (this.status != 200) {
  61. alert("pbr gm script: Error "+this.status+" loading "+address);
  62. }
  63. else {
  64. console.log("loaded: "+address)
  65. func(address,this);
  66. }
  67. };
  68.  
  69. req.send(null);
  70. return req;
  71. }