Teleport to a Random Webpage Because Why Not
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 :)
Bruh, I’m in school and it redirected me to a pic of a gun
LOL Got redirected to THIS post by it.
i have been using this website for hours now. @PDanielY
I got redirected to YouTube:)
@Codemonkey51 nicee you are one of the luckier people :)
Awesome, but strangely I keep getting pages about random biological molecules.
@AustinEntenmann lol same yeah www.ncbi.nlm.nih.gov?
I made it look better! - https://random-webpage.nilentity.repl.co/
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?
I got a page for the dictionary definition of GSYD (Go Suck Your Dick)
Thanks, Google
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
Finally got redirected to google.
Thanks SpicedSpices this website redirceted me to an automated download of Easy PowerPoint Recovery a software that costs 60 USD
OH SNAP it downloaded an exe
got redirected to an ps vita hack instant download
@Commander07 lol nice
Got redirected to and automatic download anybody need Windows 8 UEFI Firmware Update from April 4 2013
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 :)
@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
@SpicedSpices awesome man! do check out my Repls :)
i made one with python
@SpicedSpices i imported webbrowser
@SpicedSpices but on repl.it it doesn't owrk, but in VS code yes
I got redirected to never gonna let you down meme
sigh
@Warhawk947 niceeeeee thats pretty rare
@SpicedSpices lol thx
@SpicedSpices and then i got rederected to a, well, lets just say adult site...
@Codemonkey51 ik lol
Weirdly I was taken to a random module on pypi...
@NoelBryan lol thats a nice stroke of luck
So cool :o
@NoelBryan thanks :D
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
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