b- FaveletClj edit** - wiki at8a.....

; ; ;{{{ ((defn favelet [] (handle "favelet" (fn [] (let [url (.substring (.getPathInfo request) (.length "/favelet/" )) urlFixed (.replace url"http:/" "http://") ;; ??strange?? ] (str (if (.contains urlFixed "dblp") (let [ fetchS (fetch-url-s urlFixed) fbLine (re-find #"

([^<]*) <" fetchS) id (second fbLine) pageName (.replace (.get fbLine 2) " " "") ] (str "Copy to MindWiki: "))) (if (.contains urlFixed "wikipedia") (let [ wpPageName (.substring urlFixed (.length "http://de.wikipedia.org/wiki/")) pageName (.replace (.replace (.replace (.replace (.replace wpPageName "_" "") "ä" "ae") "ö" "oe") "ü" "ue") "ß" "ss") encoded (java.net.URLEncoder/encode wpPageName) editUrl (str "http://de.wikipedia.org/w/index.php?title=" encoded "&action=edit") fetchS (fetch-url-s editUrl) fbLine (re-find #"\|GEBURTSDATUM=([^\|]*)" fetchS) dates (.split (.trim (second fbLine)) " ") ; e.g. "5. März 1963" day (.replace (first dates) "." "") dayS (if (< (.length day) 2) (str "0" day) day) month (second dates) monthK (keyword (.replace month "ä" "ae")) monthS (get { :Januar "01" :Februar "02" :Maerz "03" :April "04" :Mai "05" :Juni "06" :Juli "07" :August "08" :September "09" :Oktober "10" :Novemver "11" :Dezember "12" } monthK) ] (str "Copy to MindWiki: "))))) ) "")))) ;}}}