|
Current version: 2.7a - Updated for modified format
I've been annoyed by having to scroll past the SC2 forums to get to the BW forums for a while now, and I have way too much time on my hands right now, so I polished up the two line script I posted in the power rank gone thread, and added a few other scripts.
They work with Chrome/Opera by default and Firefox with Greasemonkey installed, just download the script from herebelow, edit it if you want and install it (drag it into your browser window for Chrome/Firefox, do this on Opera (rename the scripts from foo.user.js to just foo.js if you're using Opera)), and refresh TL.
The individual scripts are:
BW TLPD Changes the TLPD search bar to search the Brood War (KR) TLPD
Remove SC2 Elo Ranks Removes the SC2 Elo ranks from below the liquipedia section on teamliquid.net
Featured Streams Changes stream sidebar to only feature BW streams on teamliquid.net
BW Liquipedia Changes the liquipedia search bar to search the Brood War liquipedia
Rearrange Forums Rearranges the sidebar forum list to make teamliquid useful for Brood War fans (also scrapes for Power Rank)
I've got a git repo up at Google code if you want to use whatever I've hacked together to barely work.
Changelog: 2.7: Fixed bugs with power rank scraping + Show Spoiler + 2.6: Merged subsection stuff Added power rank scraping to rearrange_forums
2.5: Split off each function into its own script, modified WhuazGoodJaggah's stream filter thing to move all the non-bw live streams into the non-featured section instead of removing them
2.4: Changed the link when clicking on the TLPD banner to go directly to the BW TLPD
2.3: Fixed the script run time to properly change everything before the page shows up on all 3 browsers
2.2: Swapped store and power rank links on the top bar Moved around the order in which the default changes take place so more visibly obvious changes occur first (before the page fully loads)
2.1: Added all of teamliquid and blacklisted specific pages to run the script on, instead of whitelisting every individual page
2.0: Abstracted the section relocation stuff
|
Wow this is actually really cool. Thanks a ton, will be using this
|
bless you my friend
|
This seems like a very good idea.
|
This is a better place to put it (:, I'm sure to use this, but please implement one more thing:
Have an option to filter out all SC2 streams, which can be ?toggled? so that the stream list is actually readable.
|
Thank you sir! We appreciate your work.
|
I enhanced it for Opera, http://pastebin.com/7kdgzvms
Now it executes as soon as the html has been downloaded, instead of after everything (including pictures) has been downloaded. It makes it much more seamless but I think it only works on Opera right now.
|
Zurich15306 Posts
Hey, good job! Do you want to make this configurable, so people can choose what to exclude? That would make it a great tool for everyone on this site!
|
Wow, that is quite nice, didn't even know that you could do this. :o But can't you just collapse all sc2 forums, like you did with the general forum?
|
Erm, how to remove the script when I dont want it any longer? Never used greasemonkey before...
|
On August 24 2011 21:49 Black[CAT] wrote: Erm, how to remove the script when I dont want it any longer? Never used greasemonkey before...
if you are using fire fox head on to add ons and click user script and than look on the right side it will say TL BW 2.0 and click remove it simple as 1,2,3 GG No Re.
by the way i would like to tinker around the script is there any word processor to open the script beside note pad ? It looks so clumsy and unfriendly in notepad plus I don't know what lines does what despite me having a programming background .
|
On August 24 2011 21:32 kuroshiroi wrote:I enhanced it for Opera, http://pastebin.com/7kdgzvms Now it executes as soon as the html has been downloaded, instead of after everything (including pictures) has been downloaded. It makes it much more seamless but I think it only works on Opera right now.
Oh, I didn't realize it wasn't running until everything loaded. I merged your changes in and tested it with Chrome/Firefox/Opera and it worked on all 3, thanks for the tip Also I missed some pages to whitelist (streams, some other page I forgot), so I just said fuck it and added all of www.teamliquid.net and blacklisted all of the exceptions I could find. Anyone who downloaded the script before reading this post should redownload and update to the newest version.
On August 24 2011 21:45 zatic wrote: Hey, good job! Do you want to make this configurable, so people can choose what to exclude? That would make it a great tool for everyone on this site!
It's "configurable" right now by editing the main function in the script before installing it. It's pretty simple to make it do what you want. move_section(foo, bar) moves section foo to right above bar, remove_section(foo) removes section foo, and the stuff at the bottom can be commented out/uncommented to enable/disable. I'm literally brand new to userscripts, so adding configurability through a browser page or something would probably take me a bit (I'll probably get around to it eventually if no one else does, though.
|
On August 24 2011 21:48 JustPassingBy wrote: Wow, that is quite nice, didn't even know that you could do this. :o But can't you just collapse all sc2 forums, like you did with the general forum? Well I actually read the sc2 forums, but less than the brood war forums, so collapsing/uncollapsing them over and over again would be worse than just scrolling past.
On August 24 2011 21:53 Sawamura wrote:Show nested quote +On August 24 2011 21:49 Black[CAT] wrote: Erm, how to remove the script when I dont want it any longer? Never used greasemonkey before... if you are using fire fox head on to add ons and click user script and than look on the right side it will say TL BW 2.0 and click remove it simple as 1,2,3 GG No Re. by the way i would like to tinker around the script is there any word processor to open the script beside note pad ? It looks so clumsy and unfriendly in notepad plus I don't know what lines does what despite me having a programming background .
I use vim, but notepad2 is pretty good on windows. Also, the stuff you want to edit is right at the top of the file, in the middle to bottom of this function here:
function main() { var news = new Section("nav_news_left_mid", 1, false); var general = new Section("nav_general", 1, false); var sc2 = new Section("nav_starcraft2", 1, false); var bw = new Section("nav_broodwar", 1, false); var games = new Section("nav_games", 1, false); var blogs = new Section("nav_blogs", 1, false); var replays = new Section("nav_replays", 1, false);
var calendar = new Section("nav_calendar", 2, true); var streams = new Section("nav_streams", 1, true); var tlpd = new Section("nav_tlpd", 1, true); var liquipedia = new Section("nav_wiki", 1, true); var tsl = new Section("nav_tslforum", 1, true); var poll = new Section("nav_poll", 1, true);
/* Move the Brood War forums above the SC2 forums */ move_section(bw, sc2);
/* Move replays to above poll */ move_section(replays, poll);
/* Remove poll */ //remove_section(poll);
/* Move streams to above TSL */ move_section(streams, tsl);
/* Change liquipedia search to Brood War liquipedia */ for (var i = 0; i < document.forms.length; i++) { var form = document.forms[i]; if (form.action == "http://wiki.teamliquid.net/starcraft2/index.php") form.action = "http://wiki.teamliquid.net/starcraft/index.php"; }
/* Change default tlpd search to BW (Korea) */ document.forms.namedItem('frm_tlpd_search').elements.namedItem("type").children[3].selected = true;
/* Remove SC2 Elo rank display */ var rank1 = nextObject(document.forms.namedItem('frm_tlpd_search')); var rank2 = nextObject(rank1); rank1.parentNode.removeChild(rank1); rank2.parentNode.removeChild(rank2); }
|
AWESOME Just got it. Bless you sir.
|
thanks bolt wordpad did the job .
|
Thank you b0lt ! Happy Birthday Zatic !!
|
It's good to have SC2 in it's rightful place. Below Brood War
|
Thanks, absolutely amazing.
|
On August 24 2011 21:58 b0lt wrote:Show nested quote +On August 24 2011 21:32 kuroshiroi wrote:I enhanced it for Opera, http://pastebin.com/7kdgzvms Now it executes as soon as the html has been downloaded, instead of after everything (including pictures) has been downloaded. It makes it much more seamless but I think it only works on Opera right now. Oh, I didn't realize it wasn't running until everything loaded. I merged your changes in and tested it with Chrome/Firefox/Opera and it worked on all 3, thanks for the tip Also I missed some pages to whitelist (streams, some other page I forgot), so I just said fuck it and added all of www.teamliquid.net and blacklisted all of the exceptions I could find. Anyone who downloaded the script before reading this post should redownload and update to the newest version. One thing though, the file needs to end in .js for it to work like that in Opera. i.e. the user. part needs to be removed. Otherwise it just works like normal, i.e. executing after everything has been loaded.
Nice job btw, I had a bunch of hacks for myself (like hiding the SC2 forum through CSS and changing the TLPD search to bw through a userscript) but you're a far better coder than I am
|
Is there a way to remove sections completely from the side bar, or just change the order? edit: nevermind I think you answered that.
"remove_section(sc2);" does not work T.T Guess I'll just move them for now
Is there any way you could make a script that removes SC2 events from the calendar :o It might be usable again!
|
|
|
|