PDA

View Full Version : Random Button?



PhantomFox
2016-03-26, 06:37 PM
One of my favorite things to do with long running comics is to hit the random button and start re-reading that chapter. Has anyone made a random button for OOTS, or would it be a hard thing to whip up?

Kish
2016-03-26, 06:44 PM
Rich has indicated that this is something he's not going to do, because he considers it something more appropriate to gag-a-day comics than plot-based ones like OotS.

Peelee
2016-03-26, 07:51 PM
You could always just use a random number generator and set the current comic number as the limit. Or, if you want to be thematic, roll 3d10.

DaggerPen
2016-03-26, 08:13 PM
You could always just use a random number generator and set the current comic number as the limit. Or, if you want to be thematic, roll 3d10.

That sounds like it'd take waaay too much clicking though.

I guess you could always do up a quick JavaScript thing, but then there'd be the trick of getting back to it between comics. Unless you embedded the page itself in an iframe or something, maybe? I'm not sure how that works for ad impressions though - I'd imagine it wouldn't mess with them but I wouldn't swear to it enough to distribute any code.

Also, while I can't find any mention of it in the rules, I'm p sure I've seen posts get scrubbed for containing code that can't be verified as non-malignant, so maybe best not to anyway.

Peelee
2016-03-26, 09:12 PM
That sounds like it'd take waaay too much clicking though.

I guess you could always do up a quick JavaScript thing

Hey, i thought i was the joker 'round these here parts.

Ron Miel
2016-03-26, 09:43 PM
Rich has indicated that this is something he's not going to do, because he considers it something more appropriate to gag-a-day comics than plot-based ones like OotS.


The Giant speaks:

http://www.giantitp.com/forums/showsinglepost.php?p=19239401&postcount=15

Morquard
2016-03-28, 08:59 AM
For those interested, here a really quick "Random Button" HTML page. No actual button, it will just call a random OOTS page that's all.
You will have to manually adjust the maxComicIndex to match the current max. Or don't but it won't call anything beyond that point then. :)


<!DOCTYPE html>
<script>
var maxComicIndex = 1030;
var selectedComic = Math.floor((Math.random() * maxComicIndex) + 1);
selectedComic = ("0000" + selectedComic).substr(-4,4);
window.location = 'http://www.giantitp.com/comics/oots' + selectedComic + '.html';
</script>

Edit: I just got the "Roy meets Eric in heaven" strip...

Markozeta
2016-03-28, 02:05 PM
Works for me. Different comic every time. Just copied what you wrote into Notepad++ and saved as an html.

Goosefarble
2016-03-28, 05:02 PM
I usually kinda scroll through the archive and click on a random name I don't immediately remember the plot of.

Morquard
2016-03-28, 07:19 PM
Works for me. Different comic every time. Just copied what you wrote into Notepad++ and saved as an html.

Yes, just copy and paste it into notepad or notepad++ and save it to your Desktop, the file name RandomOOTS.html for example.

Then double click it on your desktop.

(if it opens up in your editor again, you need to turn of the default file extensions. Google how that works :) )

If anyone got webspace, feel free to upload it there and post the link here for other people to use (I don't have any webspace or I'd do it myself)

littlebum2002
2016-03-29, 09:43 AM
I'm pretty sure that someone with even minor programming skills could take that code and make a Chrome extension for it. It could probably even check to see what the latest comic is.

Mayrax
2016-04-12, 02:09 PM
That button would be nice. Where's the cat so I can hand him my vote?

hagnat
2016-04-13, 10:02 AM
i have created a random comic bookmarklet

in its first iteration, it only works when you are in the comic's history page
if you press it anywhere else on the web, it will redirect you to the history page, where you then can press it again for a random comic


javascript:(function() { var url = 'http://www.giantitp.com/comics/oots.html'; if (window.location.href != url) { alert('Redirecting to Order of The Stick Comic History.\nWait for it to load and try again.'); window.location = url; return false; } if (!($ = window.jQuery)) { script = document.createElement( 'script' ); script.src = 'http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js'; script.onload = loadRandomComic; document.body.appendChild(script); } else { loadRandomComic(); } function loadRandomComic() { var links = $('.ComicList'); var key = Math.floor((Math.random() * links.length) + 1); var link = $(links[key]).find('a'); window.location = link.attr('href'); } })();

next iteration i will try to make it load the history page and process the information from there. Couldn't do it now because of HTTPS vs HTTP issues (can't ajax-load an HTTP page while inside an HTTPS one)


--
a bookmarklet is a piece of javascript code you save on your bookmark list as if it were a link
simply copy the code into the url field, and the code will be executed when you click on the bookmark