Real Life comic randomizer?

Talk about today's strip, or anything about the comic in general. You can also talk about any of the characters... but don't expect a response. They're FICTIONAL, you guys... sheesh. :)
Boredalot
Redshirt
Posts: 6
Joined: Sat Jun 11, 2005 2:02 pm
Location: The house of Jazz
Contact:

Real Life comic randomizer?

Post by Boredalot » Sat Jun 11, 2005 2:12 pm

I have a habit of browsing through the Real Life archives at random whenever the opportunity or lack of anything better to do presents itself, and I usually begin the random browsing procedure by picking out random dates and comic numbers from the archives. Is there any way that Greg could integrate a random comic picker into the Real Life archives? This would ease random browsing and create other fun opportunities like, for instance, drinking games along the lines of "If you get a comic with the Shirt Ninja, take a drink" or "If someone says 'fuego', take three drinks".

Just suggesting, 'sall.

User avatar
MrBawn
Redshirt
Posts: 87
Joined: Thu Mar 31, 2005 3:39 pm

Post by MrBawn » Sat Jun 11, 2005 5:29 pm

Pick a number between 1 and 1465. Then stick it at the end of this url:

http://www.reallifecomics.com/daily.php?strip_id=

You can update the range by looking at the url of yesterday's comic.

The php for doing this on the rlc server is quite simple:

$id=rand(1,$max_id);
readfile('http://www.reallifecomics.com/daily.php?strip_id='.$id);

User avatar
QauNuckShin
Redshirt
Posts: 99
Joined: Thu Jun 16, 2005 3:24 pm
Real Name: Snild Dolkow
Gender: Male
Location: Lund, Sweden
Contact:

Post by QauNuckShin » Thu Jun 16, 2005 5:31 pm

Summer equals bored.

That's why I made you this handy html randomizer script! Yay!

Ok, first of all, create three html files somewhere. They should be named random.html, meh.html and rlc.html. Make sure they're not named random.html.txt or such. Make explorer show you the full file name, and not hide the extensions. ;)

ok, so the files should contain these texts:

random.html:
<frameset rows="40,*">
<frame src="meh.html">
<frame src="rlc.html" name="rlc">
</frameset>
meh.html:
<a href="rlc.html" target="rlc">New comic</a>
rlc.html:
<script language="javascript">
document.write('<META HTTP-EQUIV="Refresh" Content="0; URL=http://www.reallifecomics.com/daily.php?strip_id=');
document.write((Math.floor(Math.random()*1465)+1));
document.write('.html">');
</script>
Now, when you feel like reading an old goodie, just open random.html and enjoy the all-new, fully randomized Real Life experience™!

Boredalot
Redshirt
Posts: 6
Joined: Sat Jun 11, 2005 2:02 pm
Location: The house of Jazz
Contact:

Post by Boredalot » Thu Jun 16, 2005 7:08 pm

Holy poo, it works! Thanks a bunch for working that out.

(And yes, summer really does equal bored, why the heck else would I be asking for a comic randomizer in the first place?)

User avatar
applekidjosh
Redshirt
Posts: 221
Joined: Fri Mar 18, 2005 9:06 pm
Location: Granite City, IL
Contact:

Post by applekidjosh » Thu Jun 16, 2005 7:43 pm

look at me, i'm on vacation in LA and all I do is watch anime and play video games!

User avatar
QauNuckShin
Redshirt
Posts: 99
Joined: Thu Jun 16, 2005 3:24 pm
Real Name: Snild Dolkow
Gender: Male
Location: Lund, Sweden
Contact:

Post by QauNuckShin » Thu Jun 16, 2005 9:01 pm

Well, I suppose summer's good for something.. I just haven't found it yet.

Why is it that the temperature is never just the way you like it outside? It's always too hot or too cold. Never just right..

I guess I could hang out with my girlfriend or something.. She's less dressed now. :D

User avatar
Dreamer
Redshirt
Posts: 3147
Joined: Mon Aug 18, 2003 7:48 pm
Real Name: Neil
Gender: Male
Location: Austin, TX

Post by Dreamer » Fri Jun 17, 2005 2:06 pm

Holy Smokes!
It works!!!!
My sig would have contained the secret of life, but I'd already clicked submit.

User avatar
tidu
Redshirt
Posts: 9
Joined: Fri Jun 17, 2005 6:15 pm
Location: Rovaniemi, Finland
Contact:

Post by tidu » Fri Jun 17, 2005 6:17 pm

http://tidu.org/realliferandomizer/
changed that one a bit,

Code: Select all

<script language="javascript">
document.write('<META HTTP-EQUIV="Refresh" Content="0; URL=http://www.reallifecomics.com/daily.php?do_command=show_strip&strip_id=');
document.write((Math.floor(Math.random()*1469)+1));
document.write('.html&auth=00000-00000-11111-00000-00000">');
</script>
now it shows only the image! :D

User avatar
dio
Redshirt
Posts: 55
Joined: Sun Mar 30, 2003 7:21 pm
Location: apple pie!...wait, what?

Post by dio » Fri Jun 17, 2005 7:09 pm

dude, that kicks ass! i think i'll bookmark it. :)
Image
Image <--- click me

User avatar
Deacon
Shining Adonis
Posts: 44234
Joined: Wed Jul 30, 2003 3:00 pm
Gender: Male
Location: Lakehills, TX

Post by Deacon » Fri Jun 17, 2005 7:44 pm

I knew there had to be a lot easier and simpler way to do it. After sitting down and thinking about it for a bit and doing some quick Google searches for the right code to make my concept a a reality, I found it. Just create a new HTML document and paste the following into it:

Code: Select all

<html>
<head><title>RLC Randomizer</title></head>
<body>

<script language="javascript">
document.write('<img src="http://www.reallifecomics.com/daily.php?do_command=show_strip&strip_id=');
document.write((Math.floor(Math.random()*1469)+1));
document.write('&auth=00000-00000-11111-00000-00000" onClick="window.location.reload()"></a>'); 
</script>

</body>
</html>
Then just click on the image to load a new one. Works in Firefox and IE6.

If my host were up, I'd just post URL to a completed HTML file like that. But unfortunately, no such luck.
The follies which a man regrets the most in his life are those which he didn't commit when he had the opportunity. - Helen Rowland, A Guide to Men, 1922

Boredalot
Redshirt
Posts: 6
Joined: Sat Jun 11, 2005 2:02 pm
Location: The house of Jazz
Contact:

Post by Boredalot » Fri Jun 17, 2005 10:02 pm

Now there's a solid piece of code. Thanks, Deacon.

It's also simple enough to be used on other webcomics too, like Mac Hall for instance:

Code: Select all

<html>
<head><title>Mac Hall randomizer</title></head>
<body>

<script language="javascript">
document.write('<img src="http://www.machall.com/index.php?do_command=show_strip&strip_id=');
document.write((Math.floor(Math.random()*335)+1));
document.write('&auth=01101-10010-01010-10101-11111" onClick="window.location.reload()"></a>');
</script>

</body>
</html> 
Of course, something like this would be kind of tough to implement into a keenspot-like archive where comic files are named after their post dates...hmm.

User avatar
Deacon
Shining Adonis
Posts: 44234
Joined: Wed Jul 30, 2003 3:00 pm
Gender: Male
Location: Lakehills, TX

Post by Deacon » Fri Jun 17, 2005 10:14 pm

Not really, as long as they have a sane sequential numbering scheme. You would just have to put some limits on the numbers and have a randomizing sequence for each number (e.g. 1 through 12 for the month).

And for RealLife and Mac Hall and other similarly organized webcomics, you could also edit it up a little for a quick-n-dirty Read Straight Through The Archive page. Just add something like ?num=1 after the HTML file, and have the javascript create the link to be num+1, basically, instead of picking a random number. No server-side code needed.
The follies which a man regrets the most in his life are those which he didn't commit when he had the opportunity. - Helen Rowland, A Guide to Men, 1922

Boredalot
Redshirt
Posts: 6
Joined: Sat Jun 11, 2005 2:02 pm
Location: The house of Jazz
Contact:

Post by Boredalot » Fri Jun 17, 2005 10:17 pm

I'd gladly try that out if you hadn't lost me at "?num=1". See, I don't really know jack about HTML coding in the first place and am just making a bunch of lucky guesses here and there. Not that the guessing strategy has ever let me down.

User avatar
tidu
Redshirt
Posts: 9
Joined: Fri Jun 17, 2005 6:15 pm
Location: Rovaniemi, Finland
Contact:

Re: Real Life comic randomizer?

Post by tidu » Sat Jun 18, 2005 6:29 am

Thanks Deacon for that über piece of code! :)

http://tidu.org/realliferandomizer/

User avatar
Deacon
Shining Adonis
Posts: 44234
Joined: Wed Jul 30, 2003 3:00 pm
Gender: Male
Location: Lakehills, TX

Post by Deacon » Sat Jun 18, 2005 3:27 pm

Boredalot, I mean like for tidu's URL you'd have something simple like http://tidu.org/realliferandomizer/index.html?1 and then have something along the lines of

Code: Select all

ComicNumber.value=window.location.href.substring(window.location.href.indexOf('?')+1,window.location.href.length)
Thrown in the mix, there, where ComicNumber is used in the href statement.
The follies which a man regrets the most in his life are those which he didn't commit when he had the opportunity. - Helen Rowland, A Guide to Men, 1922

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest