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

; NooMic is NoMic with SourceCode for new NooPolis WebApp's - InSpir'ed by PerlNomic ;{{{ (defn noomic [request response] (let [ ; exposes standard variables required for most pages: 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") sessionWikiName (.getAttribute (.getSession request) "WikiName") ] (import '(java.net URL) '(java.lang StringBuilder) '(java.io BufferedReader InputStreamReader)) (defn loggedIn? [] ;sessionWikiName (.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 request response)) (if (.startsWith (.getPathInfo request) (str "/do/" name)) (controller request response)))) ;(fetch-fn "Login") ;(fetch-fn "Logout") ; (fetch-fn "Rdf") ; (fetch-fn "Repl") (if ;(< 0 (.indexOf " /rdf /facebook" ; (.getPathInfo request) ;(str "-" (.getParameter request "expression") "WikiName") ; (.startsWith (.getPathInfo request) (str "/repl")) ; (fetch-fn "Repl") ; (.startsWith (.getPathInfo request) (str "/schuppen")) ; (fetch-fn "Schuppen") (or (.startsWith (.getPathInfo request) "/facebook") (.startsWith (.getPathInfo request) "/rdf") (.startsWith (.getPathInfo request) "/schuppen")) (str (if (.startsWith (.getPathInfo request) "/facebook") (fetch-fn "FaceBook")) (if (.startsWith (.getPathInfo request) "/rdf") (fetch-fn "Rdf")) (if (.startsWith (.getPathInfo request) "/schuppen") (fetch-fn "Schuppen")) ) (str " <a class="blue" href="/wiki/NooPolis">NooPolis</a> - the futuristic <a class="blue" href="/wiki/MicroNation">MicroNation</a> for the <a class="blue" href="/wiki/InterNet">InterNet</a>
Help | Contact | Imprint english | deutsch | espanol

Disclaimer

This website is only a ClickDummy that is currently under development.

Welcome

Technology accelerates. This brings opportunities and risks beyond imagination. Humanity has to face these challenges with novel ways of thinking and doing. NooPolis is an experimental MicroNation where you can engage in playful ways to invent the future.

Background

NooPolis is a project for developing the blueprint for a global multilingual world society - establishing it's own currency and legal system. Core values of NooPolis are mindfulness, responsibility, transparency and a WebOfTrust among it's citizens.

" (if (loggedIn?) (str "

Hello " sessionWikiName "

") (str "

Your Engagement

You can join NooPolis now to actively shape our MicroNation and contribute to the success of this experiment.

LogIn for Citizens

") ) ;No LogIn "

Newest Citizens

More...

RecentEvents

Connect

facebook

Follow us on Twitter

Latest Twitter Updates
    follow us
    ") ) ) ) ;}}}