Real Life comic randomizer?
Real Life comic randomizer?
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.
Just suggesting, 'sall.
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);
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);
- QauNuckShin
- Redshirt
- Posts: 99
- Joined: Thu Jun 16, 2005 3:24 pm
- Real Name: Snild Dolkow
- Gender: Male
- Location: Lund, Sweden
- Contact:
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:
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:
meh.html:<frameset rows="40,*">
<frame src="meh.html">
<frame src="rlc.html" name="rlc">
</frameset>
rlc.html:<a href="rlc.html" target="rlc">New comic</a>
Now, when you feel like reading an old goodie, just open random.html and enjoy the all-new, fully randomized Real Life experience™!<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>
- applekidjosh
- Redshirt
- Posts: 221
- Joined: Fri Mar 18, 2005 9:06 pm
- Location: Granite City, IL
- Contact:
- QauNuckShin
- Redshirt
- Posts: 99
- Joined: Thu Jun 16, 2005 3:24 pm
- Real Name: Snild Dolkow
- Gender: Male
- Location: Lund, Sweden
- Contact:
http://tidu.org/realliferandomizer/
changed that one a bit,
now it shows only the image! 
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>
- Deacon
- Shining Adonis
- Posts: 44234
- Joined: Wed Jul 30, 2003 3:00 pm
- Gender: Male
- Location: Lakehills, TX
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:
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.
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>
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
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:
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.
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> - Deacon
- Shining Adonis
- Posts: 44234
- Joined: Wed Jul 30, 2003 3:00 pm
- Gender: Male
- Location: Lakehills, TX
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.
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
- Deacon
- Shining Adonis
- Posts: 44234
- Joined: Wed Jul 30, 2003 3:00 pm
- Gender: Male
- Location: Lakehills, TX
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
Thrown in the mix, there, where ComicNumber is used in the href statement.
Code: Select all
ComicNumber.value=window.location.href.substring(window.location.href.indexOf('?')+1,window.location.href.length)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
Who is online
Users browsing this forum: No registered users and 1 guest
