/* appjet:version 0.1 */ import("storage","quickforms","lib-urdna","lib-colors","lib-clean","dlog","lib-image"); dlog.info("'",request.path,"' viewed by ", request.clientAddr,BR(),"from: ", request.headers.Referer||"(direct)"); /*to do's add status (like facebook) link to some of my best apps Guestbook DONE Side / Top Navigation 404 */
red(H1("Welcome to URDNA.ORG")); print("Urdna "+storage.status);//Sample code - storage.statushelp blue(H3("This is the wepage of the one and only Urdna!")); printp(H4("I really need to make this page amazing.... You can help my posting a comment ",link("http://comments.urdna.appjet.net","here")," when you find something that isn't working. Thanks!"));
//orange(H3("Check out some of my ",link("/java", "java applets!")," (currently not working)")); green(H4("Check out me and friend's ",link("/zelda","Zelda game!"))); //red(H4("Sign my ", link("/gbook","guestbook"),"(currently not working?)!")); //green(H5(link("/list","Look at my lists!"))); print(H4("Download my ",link("https://wiki.mozilla.org/Labs/Ubiquity","Ubiquity")," commands ",link("/ubiquity","here"),".")); red(H4("Like xkcd? Look at ",link("/xkcd","this"),"!")); green(H6(storage.maincount+" hits"));
try{//Don't break if the comic doesn't work vargot=wget(url+comic); }catch(e){ print(raw("""<script>window.location.reload()</script>""")); response.stop(true); }
print(html("To subscribe to <b>all of my commands</b>, subscribe on this page. ("),link("http://urdnafiles.appjet.net/dl/60/urdnaCommands.js","source"),html(")<br />")); print(html(" To subscribe to <b>a specific command only</b>, select a command."));
storage.ubiquity++; print(BR()); varubiquitylink=html("""<a href="https://wiki.mozilla.org/Labs/Ubiquity" target="_blank">Ubiquity</a>"""); print(H5("You must have ",ubiquitylink," to do this")); printp("Sponsor: Find great images for sale at ",link("http://TheEastSideGallery.com")); }
if(slash2()=="Share-on"){ print(H2("Share-on")); printp("Shares the page on facebook, reddit, digg, delicious, slashdot, or fark."); printp(link("http://urdnafiles.appjet.net/dl/48/share-on.js","View Source")); print(raw(""" <link rel="commands" href="http://urdnafiles.appjet.net/dl/59/share-on.js" name="Urdna Commands" /> """)); printp(link("/ubiquity","All commands")); } if(slash2()=="reddit-this"){ print(H2("reddit-this")); printp("Submits the page you're viewing to reddit"); printp(link("http://urdnafiles.appjet.net/dl/47/reddit-this.js","View Source")); print(raw(""" <link rel="commands" href="http://urdnafiles.appjet.net/dl/47/reddit-this.js" name="Urdna Commands" /> """)); printp(link("/ubiquity","All commands")); }
if(slash2()=="digg-reddit"){ print(H2("Submit-the-first-article-on-digg-to-reddit")); printp("Takes the first article from Digg, and takes you to the page to reddit it. This was created as a joke, but it is fully functional."); printp(link("http://urdnafiles.appjet.net/dl/46/digg-reddit.js","View Source")); print(raw(""" <link rel="commands" href="http://urdnafiles.appjet.net/dl/46/digg-reddit.js" name="Urdna Commands" /> """)); printp(link("/ubiquity","All commands")); } if(slash2()=="bookmark"){ print(H2("Bookmark and bookmark-load")); printp("This saves and displays web bookmarks using my free ",link("http://bookmark.appjet.net","web-bookmark app"),"."); printp(link("http://urdnafiles.appjet.net/dl/45/bookmark-this.js","View Source")); print(raw(""" <link rel="commands" href="http://urdnafiles.appjet.net/dl/45/bookmark-this.js" name="Urdna Commands" /> """)); printp(link("/ubiquity","All commands")); }
if(!msg.indexOf("<a href")>0){ dlog.info("Message containing "+msg+" sent by "+request.clientAddr)
storage.visitors.add({name:name,msg:msg,when:newDate(),uid:storage.totalcount}); }else{ printp("No links allowed, sorry"); } response.redirect("/gbook"); }else{ printp("You can only add one post per IP address, sorry."); }}
if(slash()=="zelda"){ storage.zeldacount++ printp("This is the begining of a game I'm working on with two of my friends."); print(raw(""" <object width="1100" height="800"> <param name="movie" value="combat.swf"> <embed src="http://urdnafiles.appjet.net/dl/33/my%20zelda.swf" width="1100" height="800"> </embed>
</object> """));
green(H6(storage.zeldacount+" hits")); }
if(slash()=="list"){ if(slash2()==""){ orange(H3("Lists of my stuff!")); printp(link("/","Home")); printp("To view a list of all my AppJet applications, click ",link("/list/allappjet","here"),"."); printp("To view a list of websites that I have an account, click ",link("/list/accounts","here"),".");
if(slash()=="java"){ if(slash2()==""){ print(H2("My java files")); print(H3("Downloads are not working at the moment.")); print(H4(link("/java/brick","Brick"))); print(H4(link("/java/pong","Pong"))); } if(slash2()=="brick"){ print(raw(""" <APPLET codebase="" code="http://urdnafiles2.appjet.net/dl/3/brick.class" width=200 height=200> </APPLET> """)); } if(slash2()=="pong"){ print(raw(""" <APPLET codebase="." code="http://urdnafiles2.appjet.net/dl/4/pong.class" width=200 height=200> </APPLET> """)); } }
if(slash()==storage.minPass&&slash2()!="images"){ //If the path is the password, (yes, this is a very weak system, but I just want a simple customizable urdna.org/something redirect...) storage.minPath=slash2() storage.minURL=request.query; printp(raw("MinURL updated, "+link("http://urdna.org/"+storage.minPath)+" will now redirect to "+request.query)); }
//return the first part of the path- if path is /urdna/foo it would return urdna functionslash(){ varpatha=request.path return(patha.split("/")[1]||'').split("/")[0]; }
//return the first part of the path- if path is /urdna/foo it would return foo functionslash2(){ varpatha=request.path varpatha=patha.slice(1); return(patha.split("/")[1]||'').split("/")[0]; }