Skip to content
← Back to Community
Teleport to a Random Webpage Because Why Not
Profile icon
seanlnge

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.


Disclaimer:

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.

Code

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
res.status(301).redirect("https://www.youtube.com/watch?v=dQw4w9WgXcQ");

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 :)

Voters
Profile icon
HUNTERWHITNEY
Profile icon
TylenWash
Profile icon
NilEntity
Profile icon
EekulD
Profile icon
AmethystMoon1
Profile icon
ReaperZ0v
Profile icon
ColeDen
Profile icon
ChezCoder
Profile icon
Atomic-Gamming
Profile icon
Navinor
Comments
hotnewtop
Profile icon
ChezCoder

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: http://v2mk.net/default.aspx

Profile icon
seanlnge

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

Profile icon
retronbv

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

Profile icon
Commander07

LOL Got redirected to THIS post by it.

Profile icon
HackermonDev
Profile icon
Commander07

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

Profile icon
Codemonkey51

I got redirected to YouTube:)

Profile icon
seanlnge

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

Profile icon
Codemonkey51
Profile icon
AustinEntenmann

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

Profile icon
seanlnge
Profile icon
NilEntity
Profile icon
EthanBlesch

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?

Profile icon
PaperTomato

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

Profile icon
AmethystMoon1

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" https://www.youtube.com/watch?v=isq1V_CXjjg

Profile icon
Commander07

Finally got redirected to google.

Profile icon
Commander07

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

Profile icon
Commander07

OH SNAP it downloaded an exe

Profile icon
Commander07

got redirected to an ps vita hack instant download

Profile icon
seanlnge

@Commander07 lol nice

Profile icon
Commander07

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

Profile icon
ReaperZ0v

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 :)

Profile icon
seanlnge

@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

Profile icon
ReaperZ0v

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

Profile icon
[deleted]

i made one with python

Profile icon
seanlnge

@Zuhdi28 oh nice! what is it called?

Profile icon
[deleted]

@SpicedSpices i imported webbrowser

Profile icon
seanlnge

@Zuhdi28 oh ok thats pretty cool

Profile icon
[deleted]

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

Profile icon
seanlnge

@Zuhdi28 oh ok

Profile icon
Navinor

I got redirected to never gonna let you down meme

sigh

Profile icon
seanlnge

@Warhawk947 niceeeeee thats pretty rare

Profile icon
Navinor
Profile icon
Navinor

@SpicedSpices and then i got rederected to a, well, lets just say adult site...

Profile icon
Codemonkey51
Profile icon
Navinor
Profile icon
Codemonkey51
Profile icon
Bookie0

Lol
This file cannot be displayed:

Profile icon
seanlnge
Profile icon
NoelB33

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

Profile icon
seanlnge

@NoelBryan lol thats a nice stroke of luck

Profile icon
NoelB33

So cool :o

Profile icon
seanlnge

@NoelBryan thanks :D