Hitting refresh, over and over - NSFW!

Inane baanter or words of wisdom - you decide...
Post Reply
User avatar
KlaxonCow
Baaaaaaa!
Baaaaaaa!
Posts: 8447
Joined: Fri Dec 13, 2002 3:46 am 0
Location: A large grassy field.

Re: The Return of Hitting Refresh! NSFW!

Post by KlaxonCow »

PVB wrote:As ElfQrin showed, the url is incremental. :wink:
Actually, the URL is seriously incremental. They've got thousands of images, all neatly numbered.

So neatly numbered, in fact, my programming instincts could not resist automation:

Code: Select all

<html>
 <script>
   function Random()
   {     
     imgnum = Math.floor((Math.random() * 10000));
     imgstring = imgnum.toString();

     while (imgstring.length < 8)
     {
       imgstring = "0" + imgstring;
     }

     pathstring = imgstring.substring(0, 5);

     image.src = "http://www.ize.hu/_files/pics/"+pathstring+"/"+imgstring+".jpg";
   }
 </script>
 <body onload="Random()">
  <img name="image" onClick="Random()">
 </body>
</html>
Cut and paste that into a text editor, save it as an ".html" file somewhere, then fire up the file in your browser.

It plucks out a random image from their archives. Just click on the image in order to get a new random selection (or you can hit refresh, per the thread title, but clicking on the image seems a bit easier and faster, so I added that. It does seem to get stuck at the same width and height on Firefox, if you keep clicking. Use refresh instead to sort that out. I'll leave it to someone who actually knows how to use Javascript properly to work out why that happens and suggest a fix).

There do appear to be some gaps in the numbering - if it draws up a blank, then just click on the image placeholder icon thingy to try again.

Refresh to your heart's content! :D

Image
Image
"Words ought to be a little wild - for they are assaults of thought on the unthinking."
- John Maynard Keynes
User avatar
WiredWorm
Baaaaaa!
Baaaaaa!
Posts: 3162
Joined: Thu Dec 22, 2005 4:48 pm 0
Location: Right here on the edge of my seat......

Re: The Return of Hitting Refresh! NSFW!

Post by WiredWorm »

Nice work Klaxon. And of course I had to give it a try - just to make sure it worked - y'know!! ;)

Image
GamerTag: WiredWorm
It's like another mouth - LamptonWorm
User avatar
Phineasfool
Baaaaaa!
Baaaaaa!
Posts: 2698
Joined: Mon Sep 03, 2007 5:57 pm 0
XBL Gamertag: Phineasfool
PSN: Phineasfool
Location: Colorado, USA

Re: The Return of Hitting Refresh! NSFW!

Post by Phineasfool »

So I want to know what airline this is
Image
User avatar
RedOktober
Baaaaaa!
Baaaaaa!
Posts: 4788
Joined: Sun Sep 04, 2005 11:15 pm 0
Location: Stalin's Organ
Contact:

Re: The Return of Hitting Refresh! NSFW!

Post by RedOktober »

Easy... something.
Sponsoring terrorism at £1 per mile.
User avatar
PVB
Sheepie Whore
Sheepie Whore
Posts: 32542
Joined: Mon Apr 22, 2002 10:16 pm 0
XBL Gamertag: PVBuk
PSN: PVBuk
Location: Medway, U.K.

Re: The Return of Hitting Refresh! NSFW!

Post by PVB »

RedOktober wrote:Easy... something.
:lol:

@KlaxonCow: Did I say the urls only showed a few pics? No. :wink:

Edit: Pic:

Image
Drink responsibly?
User avatar
Devlin
Baaaaa!
Baaaaa!
Posts: 1380
Joined: Tue Aug 02, 2005 10:53 pm 0
XBL Gamertag: Anarkhis
Location: Bradford, Sacred Sod of God's Own County
Contact:

Re: The Return of Hitting Refresh! NSFW!

Post by Devlin »

KlaxonCow wrote:
PVB wrote:As ElfQrin showed, the url is incremental. :wink:
Actually, the URL is seriously incremental. They've got thousands of images, all neatly numbered.

So neatly numbered, in fact, my programming instincts could not resist automation:

Code: Select all

<html>
 <script>
   function Random()
   {     
     imgnum = Math.floor((Math.random() * 10000));
     imgstring = imgnum.toString();

     while (imgstring.length < 8)
     {
       imgstring = "0" + imgstring;
     }

     pathstring = imgstring.substring(0, 5);

     image.src = "http://www.ize.hu/_files/pics/"+pathstring+"/"+imgstring+".jpg";
   }
 </script>
 <body onload="Random()">
  <img name="image" onClick="Random()">
 </body>
</html>
Cut and paste that into a text editor, save it as an ".html" file somewhere, then fire up the file in your browser.

It plucks out a random image from their archives. Just click on the image in order to get a new random selection (or you can hit refresh, per the thread title, but clicking on the image seems a bit easier and faster, so I added that. It does seem to get stuck at the same width and height on Firefox, if you keep clicking. Use refresh instead to sort that out. I'll leave it to someone who actually knows how to use Javascript properly to work out why that happens and suggest a fix).

There do appear to be some gaps in the numbering - if it draws up a blank, then just click on the image placeholder icon thingy to try again.

Refresh to your heart's content! :D

Image
Image
Can this be used to pluck out many random images(say 100 or more)?
Much like the one at toothpaste for dinner.
User avatar
KlaxonCow
Baaaaaaa!
Baaaaaaa!
Posts: 8447
Joined: Fri Dec 13, 2002 3:46 am 0
Location: A large grassy field.

Re: The Return of Hitting Refresh! NSFW!

Post by KlaxonCow »

Devlin wrote:Can this be used to pluck out many random images(say 100 or more)?
Much like the one at toothpaste for dinner.

Code: Select all

<html>
 <script>
   // Change this number to specify how many pics you want
   var nImages = 100;
   
   function MakePix()
   {
     for (i = 0; i < nImages; i++)
     {
       imgnum = Math.floor((Math.random() * 10000));
       imgstring = imgnum.toString();

       while (imgstring.length < 8)
       {
         imgstring = "0" + imgstring;
       }

       pathstring = imgstring.substring(0, 5);
 
       imgsrc = "http://www.ize.hu/_files/pics/"+pathstring+"/"+imgstring+".jpg";

       document.write('<p>[img]'+imgsrc+'[/img]<br/><img src="'+imgsrc+'"></p><hr/>');
     }
   }
 </script>
 <body onLoad="MakePix()">
 </body>
</html>
Note: Nothing is done to prevent duplicates or blanks. As per toothpaste for dinner, it might take a while to load all the images in, so "please wait". Clicking on image not added this time, hit refresh instead. Includes BBCode for image above each one, for ease of pasting into this thread. :D

@PVB: Did I say that you said the urls only showed a few pics? No. :wink:

Sir Tufty:
Image

Image
"Words ought to be a little wild - for they are assaults of thought on the unthinking."
- John Maynard Keynes
User avatar
cj2003
Baaaaa!
Baaaaa!
Posts: 1339
Joined: Tue Jan 03, 2006 12:49 pm 0
Location: Denmark
Contact:

Re: The Return of Hitting Refresh! NSFW!

Post by cj2003 »

KlaxonCow wrote:Actually, the URL is seriously incremental. They've got thousands of images, all neatly numbered.

So neatly numbered, in fact, my programming instincts could not resist automation:
Ooooohhhhhhh

Image

Image

Image
Say hi to my new website Wewalk.dk
User avatar
Anders
Baaaaaaa!
Baaaaaaa!
Posts: 9692
Joined: Tue Feb 17, 2004 4:29 pm 0
Location: Sweden

Re: The Return of Hitting Refresh! NSFW!

Post by Anders »

Image

Image

Image
The chain looks a bit loose.

Image
User avatar
Meow
Baaaaaa!
Baaaaaa!
Posts: 3991
Joined: Sat Jan 20, 2007 8:29 am 0
Location: SW Ontario

Re: The Return of Hitting Refresh! NSFW!

Post by Meow »

Image

Image

Image

Image

img]http://www.ize.hu/_files/pics/00003/00003680.jpg[/img]

Image

Image
.
.
.
.
....I'm the BEST thing that has ever happened to ME............I think therefore I'm a Yam.
User avatar
KlaxonCow
Baaaaaaa!
Baaaaaaa!
Posts: 8447
Joined: Fri Dec 13, 2002 3:46 am 0
Location: A large grassy field.

Re: The Return of Hitting Refresh! NSFW!

Post by KlaxonCow »

I just noticed.

The "funpics" site uses exactly the same style of numbering system, so I might as well revise the script to include that too. Same as before, but it now plucks the random images from either site (the choice of which is itself randomly selected). So, there's now twice as many pictures for your perusal.

Anyone know of any other sites which use a similar numbering system that I can expand it further? :D

Code: Select all

<html>
<script>
   // Change this number to specify how many pics you want
   var nImages = 100;
   
   function MakePix()
   {
     for (i = 0; i < nImages; i++)
     {
       imgnum = Math.floor((Math.random() * 10000));
       imgstring = imgnum.toString();

       while (imgstring.length < 8)
       {
         imgstring = "0" + imgstring;
       }

       pathstring = imgstring.substring(0, 5);

       if (Math.random() < 0.5)
       {
         imgsrc = "http://www.ize.hu/_files/pics/"+pathstring+"/"+imgstring+".jpg";
       }
       else
       {
         imgsrc = "http://www.funpic.hu/files/pics/"+pathstring+"/"+imgstring+".jpg";
       }

       document.write('<p><input type="text" readonly="true" size="50" value="[img]'+imgsrc+'[/img]"><br/><img src="'+imgsrc+'"></p><hr/>');
     }
   }
</script>
<body onLoad="MakePix()">
</body>
</html>
Image
Image
Last edited by KlaxonCow on Sat Oct 25, 2008 10:37 pm 0, edited 1 time in total.
"Words ought to be a little wild - for they are assaults of thought on the unthinking."
- John Maynard Keynes
User avatar
Orava
Sheepie Whore
Sheepie Whore
Posts: 12698
Joined: Sat Mar 13, 2004 12:13 am 0
Location: The West Country

Re: The Return of Hitting Refresh! NSFW!

Post by Orava »

Image

Mmm. Tea.

Image

Could become popular on the commute.

Image

Oh dear.
Holier than thou
User avatar
CarlBillen
Baaaaa!
Baaaaa!
Posts: 1410
Joined: Tue Feb 04, 2003 3:34 pm 0
Location: Belgium

Re: The Return of Hitting Refresh! NSFW!

Post by CarlBillen »

What a useful piece of code :D Well done! :D

Image

Image

Image

Image

Image

Image

Image
PS4 : Carolus-Billius
User avatar
Orava
Sheepie Whore
Sheepie Whore
Posts: 12698
Joined: Sat Mar 13, 2004 12:13 am 0
Location: The West Country

Re: The Return of Hitting Refresh! NSFW!

Post by Orava »

Image
Holier than thou
User avatar
KlaxonCow
Baaaaaaa!
Baaaaaaa!
Posts: 8447
Joined: Fri Dec 13, 2002 3:46 am 0
Location: A large grassy field.

Re: The Return of Hitting Refresh! NSFW!

Post by KlaxonCow »

Image
"Words ought to be a little wild - for they are assaults of thought on the unthinking."
- John Maynard Keynes
Post Reply