1465Views13Replies

Author Options:

GreaseMonkey Script for Instructables - Auto-All Steps - Download it Now! Answered

I whipped this up, still needs work, but it works (sorta)...
You can download it here

Now, on the Explore pages, it will automatically take you to All Steps instead of the Intro step when you click on a link.

I'm considering this open-source, so PLEASE post modifications, again I literally spent 2 minutes on this - including debug/testing time.
I know you are saying "duh its open source, its a script! moron" But what I mean is that I am encouraging modifications.

Code below if my server is down
// ==UserScript==// @name           Instructables "All Steps" Fixer// @namespace      https://www.instructables.com/tag/type:instructable/*// @description    Automatically loads All Steps instead of the Intro only// @include        https://www.instructables.com/tag/type:instructable/*// ==/UserScript==//Made by Zachninme//Although this is open-source, always leave the above line intact. Thanks.var allLinks, thisLink;allLinks = document.evaluate(    &apos//a[@href]&apos,    document,    null,    XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,    null);for (var i = 0; i < allLinks.snapshotLength; i++) {    thisLink = allLinks.snapshotItem(i);    if (thisLink.href.match(/\?/i)) {	} else {    thisLink.href += &apos?ALLSTEPS&apos;	}}

(I have zachninme.com registered, but it isn't working right... *sigh*)

Discussions

0
None
ringain-regen

Reply 4 years ago

WEBSITE IS DEAD - 06 Jan 2015

0
None
n-regenringai

Reply 4 years ago

Instructables now has a button to view all steps on one page, so this script is superfluous anyway.

0
None
mateddyn-regen

Reply 3 years ago

I hate Instructable make this allstep as a button and charge to remove this click.

Especially when I can script it away.

0
None
zachninme

12 years ago

Thanks Fungus for making the Instructable, smart!

0
None
ewilhelm

12 years ago

If you don't quit writing code and generally hacking on the site, I'm going to have to offer you a job!

0
None
zachninmeewilhelm

Reply 12 years ago

Haha
Well, don't worry, I wouldn't accept, as my JS is very poor. (although I am learning it so I can finally make the switch to Linux, ASP keeps me down)

Sorry if anything I do you consider "hacking", if you feel it is "bad", remove it immediately. I really won't take offense. (So far, I would only consider the HTML thing to be "bad" ) And I don't try to do things like hack the DB or anything, I'm not the kind of guy who would do that, and even if I was, what would I do with it? Look at your unpublished instructables? :P

Again, I'm not great at JS, so I would really like help fixing this line:
if (thisLink.href.match(/\?/i)) {
I would like it to say something along the lines of:
if ((thisLink.href.match(/\?/i)) && (thisLink.href.match("/id/"))) {

But I don't know if that "/id/" is parsed correctly. Again, my JS level right now is "combo-script-kiddie++", although it is getting better :P
0
None
fungus amungus

12 years ago

I couldn't directly install the script from that link.

I created a new file with the same code and put it here: zachninme's All Steps

This code doesn't work for direct links to Instructables, just those from the directory lists.

For example, clicking on this tasty instructable won't do it.

0
None
fungus amungusfungus amungus

Reply 12 years ago

Changing the included pages to "https://www.instructables.com/*" made it work even if it adds the "?ALLSTEPS" to everything.

Haven't seen a problem with that yet, but it's not ideal.

0
None
zachninmefungus amungus

Reply 12 years ago

Well, the way it works is it looks for all links without any URL Postback info. Then it just adds the "?ALLSTEPS". So, technically, if the page isn't looking for it, it will just be ignored, and it won't hurt anybody. There are a couple of links on the explore page that don't have any PostBack, and aren't instructables, yet they handle it just fine. Thanks for mirroring that for me, the reason why you couldn't access is my internet was down, causing my server to disconnect. Should be fine now :-)

0
None
sam

12 years ago

This is sweet, as I always want to see all of the steps on one page, but I don't know much about this sort of thing... so what do I do with it, to make it run/work? thanks!

0
None
samsam

Reply 12 years ago

nevermind, I figured it out.