|
I split up the main script into individual scripts for each feature, I've got them up at http://code.google.com/p/teamliquidbw/source/browse/ now. Also, I polished up WhuazGoodJaggah's stream filter script a bit
On August 25 2011 14:22 Cambium wrote:To OP: Instead of looping through all forms, you can simply refer to liquipedia via its XPath: var bwlpXPath = "/html/body/table/tbody/tr/td/table[2]/tbody/tr/td[3]/table[4]/tbody/tr/td/form"; node = findXPathNode( bwlpXPath ); node.action = "h__p://wiki.teamliquid.net/starcraft/index.php";
Is this actually any faster than looping through all the forms? There are only like 3 forms on the page, and document.forms should be completely populated as soon as the DOM is ready, shouldn't it? Using XPath goes through the entire html file again, and I'm kinda leery of using it because it's a lot more fragile than just iterating through the forms. (I'm lazy and want to minimize the amount of time I spend maintaining stuff)
|
On August 25 2011 15:25 b0lt wrote:I split up the main script into individual scripts for each feature, I've got them up at http://code.google.com/p/teamliquidbw/source/browse/ now. Also, I polished up WhuazGoodJaggah's stream filter script a bit Show nested quote +On August 25 2011 14:22 Cambium wrote:To OP: Instead of looping through all forms, you can simply refer to liquipedia via its XPath: var bwlpXPath = "/html/body/table/tbody/tr/td/table[2]/tbody/tr/td[3]/table[4]/tbody/tr/td/form"; node = findXPathNode( bwlpXPath ); node.action = "h__p://wiki.teamliquid.net/starcraft/index.php";
Is this actually any faster than looping through all the forms? There are only like 3 forms on the page, and document.forms should be completely populated as soon as the DOM is ready, shouldn't it? Using XPath goes through the entire html file again, and I'm kinda leery of using it because it's a lot more fragile than just iterating through the forms. (I'm lazy and want to minimize the amount of time I spend maintaining stuff)
I didn't count the number of forms, but if you say there are three, then there definitely isn't an issue with speed.
You are right about the maintenance though, xpaths are a chore.
|
putting your codes on google code is great but some people will not know how to download the script as when they click the link it doesn't allow them to download it instance and they have to right click raw file to download the specific file .
|
@b0lt
I made a patch for the streamlist thingy. http://code.google.com/p/teamliquidbw/issues/detail?id=1 The detection of the featured streams node is much better now (no more nextObject.firstChild.firstChild bullshit) All streams are now filled in 1 array and therefore only 1 loop is needed to separate them into featured and non featured. And a cosmetic change from . to •
|
Now if only it were possible to have Power Rank, TLFE and R&S back on the main page where they belong
|
On August 25 2011 18:10 writer22816 wrote:Now if only it were possible to have Power Rank, TLFE and R&S back on the main page where they belong It's possible but it would make the script kind of slow, since it'd have to scrape a few pages before it can add those things back in. Not to mention it would take a lot of work.
|
Wow I Have to use this O_O Thank you for doing this <3
|
On August 25 2011 19:18 kuroshiroi wrote:Show nested quote +On August 25 2011 18:10 writer22816 wrote:Now if only it were possible to have Power Rank, TLFE and R&S back on the main page where they belong It's possible but it would make the script kind of slow, since it'd have to scrape a few pages before it can add those things back in. Not to mention it would take a lot of work.
It'd be ok if it got PR asynchronous (if I remember correctly, js can handle that), but yea, it's a little bit more work.
|
That user streams script is fucking wonderful. Thank you.
|
|
|
You sir, are awesome. Thanks for the script.
|
Can someone which file to edit to get the Replays section under the BW rather than over on the right?
I'd rather have them connected, works better in my mind :D
|
edit the rearrange_forums.user.js
Search for:
/* Move replays to above poll */ move_section(replays, poll);
replace with:
/* Move replays below bw */ move_section(replays, bw); move_section(bw, replays);
|
is it just me or has the replay section disappeared for anyone else?
On August 28 2011 15:17 Armathai wrote: Can someone which file to edit to get the Replays section under the BW rather than over on the right?
I'd rather have them connected, works better in my mind :D
oh thanks man it wasnt in the OP. HINT HINT to me its actually better this way, no more going to the damn bottom of TL and then to the top and back down etc... i hate having to do that in the password entry area on profiles, at least this gives me a break.
|
Submited another patch for these scripts: http://code.google.com/p/teamliquidbw/issues/detail?id=2
+ Show Spoiler +Added another @exclude path (for the ad frame) (threw always an error) Added SubSections Added a count argument for nextObject and previousObject
Now it's possible to just remove certain sub sections, like Dota 2 or League of Legends.
You can get this version here or wait until b0lt updates the main repo.
|
On August 28 2011 19:10 WhuazGoodJaggah wrote:Submited another patch for these scripts: http://code.google.com/p/teamliquidbw/issues/detail?id=2+ Show Spoiler +Added another @exclude path (for the ad frame) (threw always an error) Added SubSections Added a count argument for nextObject and previousObject Now it's possible to just remove certain sub sections, like Dota 2 or League of Legends. You can get this version here or wait until b0lt updates the main repo.
Merged this, also added power rank scraping while I was at it:
|
Going to try this again tonight most likely. Crossing my fingers!
|
The re-added PR works great, thanks a bunch
Also, bumpity bump.
|
there is a small bug in the Section code.
+ Show Spoiler +function Section(id, count) { this.elements = new Array();
var link = document.getElementById(id); this.elements.push(link); for (var x = 0; x < count; x++) { this.elements.push(nextObject(link, x)); } }
|
|
|
|