α» NooMic edit** « wiki αt65.....

; NooMic is NoMic with SourceCode for new NooPolis WebApp's - InSpir'ed by PerlNomic ;{{{ (let [ hConf "TODO"; (new org.apache.hadoop.hbase.HBaseConfiguration) hBase "TODO" ;(new org.apache.hadoop.hbase.client.HBaseAdmin hConf) logTableDesc "TODO" ;(new org.apache.hadoop.hbase.HTableDescriptor "ChatLog") ] (import '(java.net URL) '(java.lang StringBuilder) '(java.io BufferedReader InputStreamReader)) (defn loggedIn? [] (.getAttribute (.getSession request) "WikiName") ) (defn fetch-url-s "Return the web page as a string." ;http://gnuvince.wordpress.com/2008/11/18/fetching-web-comics-with-clojure-part-2/ [address] (let [url (java.net.URL. address)] (with-open [stream (. url (openStream))] (let [buf (java.io.BufferedReader. (java.io.InputStreamReader. stream))] ((defn a [b] (let [line (.readLine b)] (if (nil? line) "" (str line (a b))))) buf))))) (defn fetch-url "Return the web page as a string." ;http://gnuvince.wordpress.com/2008/11/18/fetching-web-comics-with-clojure-part-2/ [address] (let [url (java.net.URL. address)] (with-open [stream (. url (openStream))] (let [buf (java.io.BufferedReader. (java.io.InputStreamReader. stream))] ;skip empty lines: (.readLine buf) (.readLine buf) (.readLine buf) (.readLine buf) (.readLine buf) (.readLine buf) (.readLine buf) (.readLine buf) (.readLine buf) (.readLine buf) (.readLine buf) ((defn a [b] (let [line (.readLine b)] (if (or (nil? line) (.equals line "")) "" (str (.replace (.replace (.replace (.replace line "\u0026quot;" "\"") "\u0026gt;" ">") "\u0026lt;" "<") "\u0026amp;" "\u0026") "\r\n" (a b))))) buf))))) (defn fetch-fn [name] (eval (read-string (fetch-url (str "http://mindbroker.de/wiki/" name "Clj?skin=raw"))))) (fetch-fn "Cache") (fetch-fn "Handle") (defn handle [name view controller] (if (.startsWith (.getPathInfo request) (str "/" name)) (str "

" (.toUpperCase (.substring (str name " ") 0 1)) (.substring (str name " ") 1) "

" (view)) (if (.startsWith (.getPathInfo request) (str "/do/" name)) (controller)))) (fetch-fn "Login") (fetch-fn "Logout") (if ; non standard-YaMl handling: (or (.startsWith (.getPathInfo request) "/facebook") (.startsWith (.getPathInfo request) "/kml") (.startsWith (.getPathInfo request) "/rdf")) (if (.startsWith (.getPathInfo request) "/facebook") (fetch-fn "FaceBook") (if (.startsWith (.getPathInfo request) "/kml") (fetch-fn "FarmKml") (if (.startsWith (.getPathInfo request) "/rdf") (fetch-fn "Rdf") ) ) ) (str "\r" " <a class="blue" href="/wiki/NooPolis">NooPolis</a> - a <a class="blue" href="/wiki/MicroNation">MicroNation</a> on the <a class="blue" href="/wiki/InterNet">InterNet</a>

NooPolis is an emerging futuristic MicroNation on the InterNet. JoinNow and you can create EnterPrises for the TwentyFirstCentury as part of a complex long running StartUpSimulation and trade them on the MindFloor.

" (if (.equals (.getPathInfo request) "/menow") "

What are you thinking?

Qu'est-ce que tu pense?

Was denkst Du?

") (fetch-fn "Bank") (fetch-fn "Citizens") (fetch-fn "Farm") (fetch-fn "Favelet") (fetch-fn "Fleet") (fetch-fn "FutureMap") (fetch-fn "FutureNews") (fetch-fn "Index") (fetch-fn "Join") ;(fetch-fn "MindBase") (fetch-fn "PieschenRadio") (fetch-fn "PieschenTv") (fetch-fn "Repl") (fetch-fn "Schuppen") (fetch-fn "Summit") (fetch-fn "Wiki") "
\r" "" ) ) ) ) )) ;}}}