Here is the original post:
With this program, you can go onto theinternetRednet!
To browse websites, use thisclientProgram:
Download
http://pastebin.com/CuqtxjvM
Update
You no longer need to download a separate program for hosting websites!
Versions:
Client : 2.4
Server: 2.4 (Now Merged)
Nexus Edition : 2.4
New with 2.0:
- Merged Server and Client
- Updated The Server Look
- Server is now infinite lines
- Added Shortcuts:
- - CTRL = Browse
- - F5 = Refresh
- Updated API( or added a API xP)
- Improved Browsing Speeds
- Added a webpage the only occurs when you didn't connect correctly.
- You no longer need the HTTP api :)/>/> (that's why it is faster)
- The server now loads the webpage off a file, so you have to update your websites to use Lua
- The browser now remembers if it is a server. So if you reboot the PC, it will automatically switch to the server file and host the file you selected.
- After alot of bugs, glitches, and debugging, I have finally re-added the editor from 1.0 :)/>/>
- Added a search engine API, if you enable searchbots, your site will send you information if you receive rednet.api.ping.searchengine
- De-Localized Address, so you can now redirect users (See API for more information)
- Fixed your web browser crashing if you go to a site with a "/" in it's name
API:
title = "" --Changes "Rednet Explorer 2.2" on the top of the screen to whatever you want.
reDirect("home") --Changes your web address and redirects you to "home"
Custom Servers and User made websites
[2.4+] Google by me :)/>/>
Spoiler
Website Code:
sleep(0) --So you don't go too fast
write("Search for: ")
input = read()
rednet.broadcast("rednet.api.ping.searchengine") --Send a message to all listening servers
while true do -- Start the loop
local a, i = rednet.receive(0) --Begin receiving for all servers that received the message
if i then --If you receive a message then...
if input == "" then
print("Search: " ..i) --Print the address
else
if string.find(i, input) then
print("Search: " ..i) --Print the address
end
end
else --If you dont receive a message or you received every message then...
break --Stop the searching
end
end--Finish the loop
Server Code:*default*
Description:
This is a basic search engine. It prints all the webservers (Doesn't print older webservers and it glitches out if you have to much webservers.)
Spoiler
Website Code:
write("Save path: ")
a = read()
fs.delete(a)
shell.run("pastebin","get","CuqtxjvM",a)
shell.run(a)
Server Code:
*default*
Description:
This site updates ur browser when you open it
[2.4.1+] bit.ly by me :)/>/> :D/>/> :)/>/> (come on, why isn't anyone submitting?)
Spoiler
Website Code (SAVE AS www.bit.ly OR IT WILL NOT WORK!!!!):
local cPrint = function(text)
local x2,y2 = term.getCursorPos()
local x, y = term.getSize()
term.setCursorPos(math.ceil((x / 2) - (text:len() / 2)), y2)
print(text)
end
cPrint("bitly")
cPrint("Shorten, share and track your links")
cPrint("---")
input = read(nul, "Shorten Links Here")
rando1m = math.random(1000,9999)
rednet.broadcast("bit.ly/newAPI?v=" ..rando1m.. "&l=" ..input)
print("Link made! URL: bit.ly/" ..rando1m)
Server Code:
http://pastebin.com/VGJ7L1sn
Description:
Shorten links with the click of 1 button!
Known bugs that I could fix but I was too lazy to:
- Since it generates a random number, it doesn't check if it already exists, so if you have the 1000/9999 chance of getting the same site, it will not work
[2.0+] GlobalSites "Go to your website anywhere!" by… me… again D:
Spoiler
Website Code:
local printVersion(version)
term.clear()
term.setCursorPos(1,1)
cPrint(title)
cPrint("rdnt://"..version.."n")
end
local cPrint = function(text)
local x, y = term.getSize()
local x2,y2 = term.getCursorPos()
term.setCursorPos(math.ceil((x / 2) - (text:len() / 2)), y2)
print(text)
end
print("1; Host site")
print("2; Visit site")
input = read()
if input == 1 then
printVersion("host")
write("Site Path: ")
shell.run("pastebin", "put", read())
elseif input == 2 then
printVersion("join")
write("Site Pastebin ID: ")
fs.delete(".testfile")
input = read()
shell.run("pastebin", "get", , ".testfile")
printVersion("join/" ..input)
shell.run(".testfile")
end
Server Code:
*default*
Description:
Go to your website from any server, any time, any where!
How to use and make a search engine:
Spoiler
<p>You may have noticed I added "Added a search engine API" to the changelog for 2.4. How do I use it? First, here are the basics:<u></u><br></p><ol><li>Broadcast&nbsp;"rednet.api.ping.searchengine" to ping every site.<br></li></ol><p>Try this:</p><p><br>rednet.broadcast("rednet.api.ping.searchengine")<br>print(rednet.receive(0))<br>
</p><p>Nothing happens? Right.</p><p>That's because of our crash bypass in the servers. This message triggers our crash detector and ignores it since you&nbsp;broadcasted&nbsp;2 messages:</p><p>1) The address of your site</p><p>2) The message to ping the sites</p><p>Try this:</p><p><br></p><p>sleep(0)<br>rednet.broadcast("rednet.api.ping.searchengine")<br>print(rednet.receive(0))<br>
</p><p>It should print the address of your site. Try this to receive every address</p><p><br>sleep(0)<br>rednet.broadcast("rednet.api.ping.searchengine")<br>while true do<br>local a, i = rednet.receive(0)<br>if i then<br>&nbsp; print("Search: " ..i)<br>else<br>&nbsp; break --Stop the searching<br>end<br>end<br>
</p><p>Now, it will ping every site then start a loop that prints every message it receives and breaks if it doesn't receive a message.</p>
sleep(0) --So you don't go too fast
rednet.broadcast("rednet.api.ping.searchengine") --Send a message to all listening servers
while true do -- Start the loop
local a, i = rednet.receive(0) --Begin receiving for all servers that received the message
if i then --If you receive a message then...
print("Search: " ..i) --Print the address
else --If you dont receive a message or you received every message then...
break --Stop the searching
end
end--Finish the loop