Share your repls and programming experiences

← Back to all posts
Teleport to a Random Webpage Because Why Not
SpicedSpices (309)

Have you ever wanted to just visit a random webpage without any knowledge of what is on it? Because if so, this is the perfect Repl for you.

I was bored at 1:47 AM this morning, so I came up with an idea. I decided to try to make a Repl that will redirect you to a completely random webpage. I didn't know how to come up with the random webpage though.

After some careful consideration, I decided on randomly generating a string with a random length, and searching it up in Bing to take the first link that shows up.

I don't know why I tried to do this, but I guess it is pretty cool.


Obviously random is not possible in the world of computing, so the way I found a 'random' webpage, was to create a random string with letters A-Z and numbers 0-9, and searching it up into Bing to take the first link that appeared.

Although not totally random, it still produces really weird websites.

Libraries / Frameworks

  • Express.JS for sending files and links to client.
  • HTTP for creating a server
  • Crawler for searching the web to take this links.


Randomly Generated String
let length = Math.floor(Math.random()*(max+1-min))+min;
  let str = (Math.floor(Math.random()*36**length)+1).toString(36);
Redirect to External Website

Disclaimer #2 ?

I used Bing to search things up because it is easier to find things in inspect element when this crawls the web.

Bing does have a safe search on by default, so this will be protected from any NSFW websites. Although it has safe search, that does not mean that there are malicious websites that might slip through the filter. Please while using this site, be cautious . If you would like, use a VPN, proxy, or a VM to make sure that no malicious websites will be bad for your computer.

Thank you for checking out this Repl.

If you enjoyed it, an upvote would always be appreciated. If not, please tell me how I could improve this Repl in the comments. Thanks :)

ChezCoder (1606)

this is a beautiful demonstration of the uses of web crawling, pseudo random, and many other aspects of programming, fit so snuggly in one project. Bravo, heres an upvote!

Edit, look what site i was sent to :/

Edit x2: Make a button and a input, the input contains a number, the button opens multiple webpages depending on the input. If the input were 4, then it opens 4 new webpages.

Edit x3: I will never forgive my self:

SpicedSpices (309)

wow thanks @ChezCoder i appreciate that :)

For Edit 1: Thats pretty secretive lol
For Edit 2: Ok that makes sense i'll have a cap on it though so no insane lag
For Edit 3: Bruh... glad i have a disclaimer :p that needs to be fixed

retronbv (131)

Bruh, I’m in school and it redirected me to a pic of a gun

Commander07 (36)

LOL Got redirected to THIS post by it.

Commander07 (36)

i have been using this website for hours now. @PDanielY

Codemonkey51 (1061)

I got redirected to YouTube:)

SpicedSpices (309)

@Codemonkey51 nicee you are one of the luckier people :)

AustinEntenmann (1)

Awesome, but strangely I keep getting pages about random biological molecules.

SpicedSpices (309)

@AustinEntenmann lol same yeah


EthanBlesch (8)

This is really cool! It often redirects you to websites that contain gibberish string or something similar, so maybe finding a dictionary and making it an array, then using that instead or with the random string?

PaperTomato (0)

I got a page for the dictionary definition of GSYD (Go Suck Your Dick)
Thanks, Google

gwood5901 (21)

I got redirected to a GTA playthrough on youtube with 4 views, a UN funded project, a telescope for sale, a USB for sale. Good job! upvote.
Edit: lol I got sent to a youtube video "1hr of relaxing miracle sounds"

Commander07 (36)

Finally got redirected to google.

Commander07 (36)

Thanks SpicedSpices this website redirceted me to an automated download of Easy PowerPoint Recovery a software that costs 60 USD

Commander07 (36)

OH SNAP it downloaded an exe

Commander07 (36)

got redirected to an ps vita hack instant download

Commander07 (36)

Got redirected to and automatic download anybody need Windows 8 UEFI Firmware Update from April 4 2013

ReaperZ0v (50)

very impressive :D
javascript is quite smooth, I'm a python developer but with that being said javascript is as special to me as python :)

SpicedSpices (309)

@ReaperZ0v thanks I appreciate that :D
yeah I like javascript because I like curly brackets and its syntax, but I really like the simplicity and intuitivity of python

ReaperZ0v (50)

@SpicedSpices awesome man! do check out my Repls :)


i made one with python

SpicedSpices (309)

@Zuhdi28 oh nice! what is it called?


@SpicedSpices i imported webbrowser

SpicedSpices (309)

@Zuhdi28 oh ok thats pretty cool


@SpicedSpices but on it doesn't owrk, but in VS code yes

Warhawk947 (524)

I got redirected to never gonna let you down meme


NoelB33 (352)

Weirdly I was taken to a random module on pypi...

SpicedSpices (309)

@NoelBryan lol thats a nice stroke of luck