League Forum Links

dfsdf

  1. // ==UserScript==
  2. // @name League Forum Links
  3. // @namespace pbr_lfl
  4. // @include http://goallineblitz.com/game/team.pl?*
  5. // @include http://goallineblitz.com/game/league.pl?*
  6. // @version 09.03.01
  7. // @description dfsdf
  8. // ==/UserScript==
  9.  
  10. /*
  11. *
  12. * pabst did this
  13. *
  14. */
  15.  
  16. var forumNames = [
  17. "USA","Canada","Europe East","Europe West","Oceania","South America","Southeast Asia","Africa","Casual Leagues","Pee Wee Leagues","Europe West Pro League","Europe West AAA League","Europe West AA League","Europe West A Leagues","Europe West BBB Leagues","Europe West Alternative Language Forum","Casual A Leagues","Casual BBB Leagues","Europe East Pro League","Europe East AAA Leagues","Europe East AA Leagues","Europe East A Leagues","Europe East Alternative Languages Forum","Europe East BBB Leagues","toysldr0's Eastern Europe Pro Daily League Preview","Canadian Pro League","Canadian AAA Leagues","Canadian AA Leagues","Canadian A Leagues","Canadian BBB Leagues","Southeast Asia Pro League","Southeast Asia AAA Leagues","Southeast Asia AA Leagues","Southeast Asia A Leagues","Pee Wee League #1","Pee Wee League #2","Pee Wee League #3","Pee Wee League #4","Pee Wee League #5","Pee Wee League #6","Pee Wee League #7","Pee Wee League #8","Pee Wee League #9","Pee Wee League #10","Pee Wee League #11","Pee Wee League #12","Pee Wee League #13","Pee Wee League #14","Pee Wee League #15","Pee Wee League #16","Pee Wee League #17","Pee Wee League #18","Pee Wee League #19","Pee Wee League #20","Pee Wee League #21","Pee Wee League #22","Pee Wee League #23","Pee Wee League #24","Pee Wee League #25","USA Pro League","USA AAA Leagues","USA AA Leagues","USA A Leagues","USA BBB Leagues","South America Pro League","South America AAA Leagues","South America AA Leagues","South America A Leagues","South America BBB Leagues","Africa Pro League","Africa AAA League","Africa AA League","Africa A League","Casual A #1","Casual A #2","Casual A #3","Casual A #4","Casual A #5","Oceania Pro League","Oceania AAA Leagues","Oceania AA Leagues","Oceania A Leagues","Europe West AAA #1","Europe West AAA #2","Western Europe A #1","Western Europe A #2","Western Europe A #3","Western Europe A #4","Western Europe A #5","Western Europe A #6","Western Europe A #7","Western Europe A #8","Casual BBB #1","Casual BBB #2","Casual BBB #4","Casual BBB #5","Casual BBB #6","Casual BBB #7","Casual BBB #8","Casual BBB #3","Casual BBB #9","Casual BBB #10","Europe West BBB #1","Europe West BBB #2","Europe West BBB #3","Europe West BBB #4","Europe West BBB #5","Europe West BBB #6","Europe West BBB #7","Europe West BBB #8","Europe West BBB #9","Europe West BBB #10","Europe West BBB #11","Europe West BBB #12","Europe West BBB #13","Europe West BBB #14","Europe West BBB #15","Europe West BBB #16","Europe East AA #1","Europe East AA #2","Europe East AA #3","Europe East AA #4","Europe West AA #1","Europe West AA #2","Europe West AA #3","Europe West AA #4","Europe East AAA #1","Europe East AAA #2","Canada AAA #1","Canada AAA #2","Canada AA #1","Canada AA #2","Canada AA #3","Canada AA #4","Europe East A #1","Europe East A #2","Europe East A #3","Europe East A #4","Europe East A #5","Europe East A #6","Europe East A #7","Europe East A #8","Southeast Asia AA #1","Southeast Asia AA #2","Southeast Asia AA #3","Southeast Asia AA #4","Europe East BBB #1","Europe East BBB #2","Europe East BBB #3","Europe East BBB #4","Europe East BBB #5","Europe East BBB #6","Europe East BBB #7","Europe East BBB #8","Europe East BBB #9","Europe East BBB #10","Europe East BBB #11","Europe East BBB #12","Europe East BBB #13","Europe East BBB #14","Europe East BBB #15","Europe East BBB #16","South America AAA #1","South America AAA #2","Southeast Asia A #1","Southeast Asia A #2","Southeast Asia A #3","Southeast Asia A #4","Southeast Asia A #5","Southeast Asia A #6","Southeast Asia A #7","Southeast Asia A #8","Canadian A #1","Canadian A #2","Canadian A #3","Canadian A #4","Canadian A #5","Canadian A #6","Canadian A #7","Canadian A #8","Oceania AA #1","Oceania AA #2","Oceania AA #3","Oceania AA #4","Southeast Asia AAA #1","Southeast Asia AAA #2","Africa AAA #1","Africa AAA #2","South America AA #1","South America AA #2","South America AA #3","South America AA #4","Canadian BBB #1","Canadian BBB #2","Canadian BBB #3","Canadian BBB #4","Canadian BBB #5","Canadian BBB #6","Canadian BBB #7","Canadian BBB #8","Canadian BBB #9","Canadian BBB #10","Canadian BBB #11","Canadian BBB #12","Canadian BBB #13","Canadian BBB #14","Canadian BBB #15","Canadian BBB #16","Africa AA #1","Africa AA #2","Africa AA #3","Africa AA #4","USA AAA #1","USA AAA #2","South America A #1","South America A #2","South America A #3","South America A #4","South America A #5","South America A #6","South America A #7","South America A #8","Oceania A #1","Oceania A #2","Oceania A #3","Oceania A #4","Oceania A #5","Oceania A #6","Oceania A #7","Oceania A #8","USA AA #1","USA AA #2","USA AA #3","USA AA #4","Africa A #1","Africa A #2","Africa A #3","Africa A #4","Africa A #5","Africa A #6","Africa A #7","Africa A #8","Oceania AAA #1","Oceania AAA #2","South America BBB #1","South America BBB #2","South America BBB #3","South America BBB #4","South America BBB #5","South America BBB #6","South America BBB #7","South America BBB #8","USA A #1","USA A #2","USA A #3","USA A #4","USA A #5","USA A #6","USA A #7","USA A #8","USA BBB #1","USA BBB #2","USA BBB #3","USA BBB #4","USA BBB #5","USA BBB #6","USA BBB #7","USA BBB #8","USA BBB #9","USA BBB #10","USA BBB #11","USA BBB #12","USA BBB #13","USA BBB #14","USA BBB #15","USA BBB #16"
  18. ];
  19.  
  20. var forumID = [
  21. 11,12,13,14,15,16,17,140,3601,3602,51,52,53,177,1877,54,3603,3604,48,49,50,251,65,2783,69,45,46,47,187,1167,126,127,168,269,3620,3621,3622,3623,3624,3625,3626,3627,3628,3629,3630,3631,3632,3633,3634,3635,3636,3637,3638,3639,3640,3641,3642,3643,3644,40,41,42,43,44,122,123,124,242,3652,141,142,143,1184,3605,3606,3607,3608,3609,118,119,173,260,112,113,178,179,180,181,182,183,184,185,3610,3611,3613,3614,3615,3616,3617,3612,3618,3619,1878,1879,1880,1881,1882,1883,1884,1885,1886,1887,1888,1889,1890,1891,1892,1893,108,109,110,111,114,115,116,117,106,107,100,101,102,103,104,105,252,253,254,255,256,257,258,259,129,169,170,171,2784,2785,2786,2787,2788,2789,2790,2791,2792,2793,3646,3647,3648,3649,3650,3651,162,163,270,271,272,273,274,275,276,277,188,189,190,191,192,193,194,195,121,174,175,176,167,128,144,145,125,164,165,166,1168,1169,1170,1171,1172,1173,1174,1175,1176,1177,1178,1179,1180,1181,1182,1183,146,147,148,149,70,71,243,244,245,246,247,248,249,250,261,262,263,264,265,266,267,268,72,73,74,75,1186,1187,1188,1189,1190,1191,1192,1193,172,120,3653,3654,3655,3656,3657,3658,3659,3660,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99
  22. ];
  23.  
  24. window.setTimeout( function() {
  25. if (window.location.toString().indexOf("team.pl") != -1) {
  26. var league = document.getElementById("team_league").firstChild;
  27. leagueForumMain(league);
  28. }
  29. else if (window.location.toString().indexOf("/league.pl") != -1) {
  30. var league = document.getElementsByClassName("big_head subhead_head")[0].firstChild;
  31. leagueForumMain(league);
  32. }
  33. else {
  34. //leagueForumLinksSearch();
  35. }
  36. }, 250
  37. );
  38.  
  39. var continents = ["Africa","America","Asia","Canadian","Canada","Europe","Oceania","USA","Casual","Pee Wee"];
  40. var forumLinks = [];
  41.  
  42. var fnames;
  43. var fids;
  44.  
  45. function leagueForumLinksSearch() {
  46. // include http://goallineblitz.com/game/forum_main.pl
  47. fnames = document.createElement("div");
  48. fnames.id = "fnames";
  49. document.getElementById("header").appendChild(fnames);
  50. fids = document.createElement("div");
  51. fids.id = "fids";
  52. document.getElementById("footer").appendChild(fids);
  53. var forums = document.getElementsByClassName("forum_title");
  54. for (var i=0; i<forums.length; i++) {
  55. for (var j=0; j<continents.length; j++) {
  56. if (forums[i].innerHTML.indexOf(continents[j]) != -1) {
  57. var href = forums[i].href.toString().slice(forums[i].href.toString().indexOf("=")+1);
  58. //console.log(forums[i].innerHTML+" --- "+href);
  59. forumLinks.push(forums[i]);
  60. var href = forums[i].href.toString().slice(forums[i].href.toString().indexOf("=")+1);
  61. fnames.innerHTML += '"'+forums[i].innerHTML+'",';
  62. fids.innerHTML += href+',';
  63. getInetPage(forums[i].href, forumLinkHandler, null);
  64. break;
  65. }
  66. }
  67. }
  68. }
  69.  
  70. function forumLinkHandler(address, page) {
  71. var div = document.createElement("div");
  72. div.innerHTML = page.responseText;
  73. var forums = div.getElementsByClassName("forum_title");
  74. for (var i=0; i<forums.length; i++) {
  75. var href = forums[i].href.toString().slice(forums[i].href.toString().indexOf("=")+1);
  76. fnames.innerHTML += '"'+forums[i].innerHTML+'",';
  77. fids.innerHTML += href+',';
  78. //console.log(forums[i].innerHTML+" --- "+href);
  79. forumLinks.push(forums[i]);
  80. getInetPage(forums[i].href, forumLinkHandler, null);
  81. }
  82. }
  83.  
  84. function getInetPage(address, func, target) {
  85. var req = new XMLHttpRequest();
  86. req.open( 'GET', address, true );
  87. req.onreadystatechange = function() {
  88. if (target != null) {
  89. var d = ["..","...","."];
  90. var str = target.innerHTML.split(" ");
  91. target.innerHTML = str[0]+" "+d[str[1].length-1];
  92. }
  93. };
  94. req.onload = function() {
  95. if (this.status != 200) {
  96. console.log("pbr gm script: Error "+this.status+" loading "+address);
  97. getInetPage(address, func, target);
  98. }
  99. else {
  100. //console.log("loaded: "+address)
  101. func(address,this);
  102. }
  103. };
  104. req.send(null);
  105. return req;
  106. }
  107.  
  108. var lead="http://goallineblitz.com/game/forum_thread_list.pl?forum_id="
  109. function leagueFix(l) {
  110. var r = l.replace("African","Africa");
  111. r = r.replace("Canadian","Canada");
  112. r = r.replace("Eastern Europe","Europe East");
  113. r = r.replace("Western Europe","Europe West");
  114. return r;
  115. }
  116.  
  117. function leagueForumMain(league) {
  118. var strings = [];
  119. var splits = league.innerHTML.split(" ");
  120. if (splits.length == 3) {
  121. strings[0] = splits[0];
  122. //console.log(splits.length);
  123. }
  124. else if (splits.length == 4) {
  125. strings[0] = splits[0]+" "+splits[1];
  126. //console.log(splits.length);
  127. }
  128. else {
  129. console.log("wtf? --- "+splits);
  130. }
  131. strings[0] = leagueFix(strings[0]);
  132. strings[1] = strings[0]+" "+splits[splits.length-2];
  133. strings[2] = strings[1]+" "+splits[splits.length-1];
  134. //console.log("strings="+strings);
  135.  
  136. var count = 0;
  137. var myForums = [];
  138. for (var i=0; i<forumNames.length; i++) {
  139. var t = forumNames[i];
  140. t = t.replace(" Leagues","");
  141. t = t.replace(" League","");
  142. t = leagueFix(t);
  143. var id = forumID[i];
  144. for (var j=0; j<strings.length; j++) {
  145. //console.log("'"+strings[j]+"' || '"+t+"'"+" : "+count);
  146. if (strings[j].replace(" League","") == t) {
  147. myForums.push([t,id]);
  148. strings.splice(j,1);
  149. count++;
  150. break;
  151. }
  152. }
  153. if (count == 3) break;
  154. }
  155. //console.log(forumNames.length+"/"+forumID.length+"/"+myForums.length+"="+myForums);
  156.  
  157. var bar = document.getElementsByClassName("subhead_link_bar")[0];
  158. if (window.location.toString().indexOf("league.pl") == -1) {
  159. var teamid = window.location.toString().slice(window.location.toString().indexOf("=")+1);
  160. bar.appendChild(createLink("Team Forum","/game/forum_thread_list.pl?team_id="+teamid));
  161. }
  162.  
  163. var lead="/game/forum_thread_list.pl?forum_id="
  164. for (var i=myForums.length-1; i>=0; i--) {
  165. bar.appendChild(createLink(myForums[i][0]+" Forum",lead+myForums[i][1]));
  166. }
  167. }
  168.  
  169. function createLink(name, address) {
  170. var a = document.createElement("a");
  171. a.href = address;
  172. a.innerHTML = name;
  173.  
  174. var d = document.createElement("div");
  175. d.setAttribute("style","height: 20px; float: left; margin-right: 1px;");
  176. d.appendChild(a);
  177. return d;
  178. }
  179.  

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址