b- WikiClj edit** - wiki at8a.....

;create WikiPage views ;{{{ ((defn wiki [] (handle "wiki" (fn [] (let [name (.substring (.getPathInfo request) 6)] (if (.startsWith (.getPathInfo request) "/wiki/" ) (str "

" name "

" (if (cache :picCache (keyword name)) (do (Class/forName "org.apache.derby.jdbc.EmbeddedDriver") (let [con (java.sql.DriverManager/getConnection"jdbc:derby:base;create=true" "SYSDBA" "masterkey") stmt (.createStatement con) rs (.executeQuery stmt (str "select * from depot,user_ where depot.user_id=user_.id and user_.wikiname='" name "'"))] (if (.next rs) (str " PremiumCitizen?
MindId:" (.getInt rs "baseid")"
KayGroschen:" (.getInt rs "kaygroschen")"
"))))) (let [buf (new java.io.BufferedReader (new java.io.StringReader (fetch-url (str "http://mindbroker.de/wiki/" name "?skin=raw"))))] ((fn mapLine [mode] (let [line (.readLine buf)] (if line (str (if (.startsWith line "* ") ;;TODO (.compile "\* [A-Z]+[a-z]+[A-Z]+[a-z]+[a-zA-Z0-9]*: " (str "
  • " (.substring line 2) "
  • ") ) (if (.equals "" line) "
    " ) (if (.startsWith line "|") (str (if (= mode :table) "" "") "" (mapLine :table))) (if (= mode :table) (if (.startsWith line "|") "" "
    " (apply str (map (fn [x] (str x "")) (.split (.substring line 1) "\\|"))) "
    ")) (if (.startsWith line "!") (if (.startsWith line "!!") (if (.startsWith line "!!!") (str "

    " (.substring line 3) "

    ") (str "
    " (.substring line 2) "
    ") ) (str "
    " (.substring line 1) "
    ") ) ) (mapLine nil)) "") )) nil)))))) ""))) ;}}}