b- FaceBookClj edit** - wiki at8a.....

; ; test at ; http://apps.facebook.com/mindbroker ;{{{ ((defn facebook [] (handle "facebook" (fn [request response] (str " PieschenBank MindFloor Vote connect with your Friends! " (if (.startsWith (.getRequestURI request) "/facebook/connect") " ") (if (.startsWith (.getRequestURI request) "/facebook/vote") (str (if (.getParameter request "vote") (str "voted for " (.getParameter request "vote"))) "

MindVote

Vote for StartUpSaxony now! ")) (if (.startsWith (.getRequestURI request) "/facebook/tv") "") (if (.startsWith (.getRequestURI request) "/facebook/bank") "

PieschenBank

") (if (.startsWith (.getRequestURI request) "/facebook/rooms") "

RoomBooker

") (if (.startsWith (.getRequestURI request) "/facebook/debug") (str "URI: " (.getRequestURI request) "
" "ParameterNames: " (apply str (map (fn [x] (str x ": " (.getParameter request x) "
")) (enumeration-seq (.getParameterNames request)))) "
" "FaceBook user props: " "
" (let [prop (new java.util.Properties) tmp (.load prop (new java.io.FileInputStream "/home/noopolis/fb.props")) ;com.google.code.facebookapi.FacebookParam/SESSION_KEY: sessKey (.getParameter request "fb_sig_session_key") ;canvas (.getCanvasRequest ; (new net.sf.fb4j.canvas.CanvasApplication fbClient (new com.google.code.facebookapi.FacebookJsonRestClient "7d14d5abc7a6822f9acc8453e868516a" ; (.getProperty prop "apiKey") (.getProperty prop "secretKey") sessKey)] (try (let [;sess (.getFacebookSession canvas) ;userInfo (.getUserInfo (.values net.sf.fb4j.model.UserInfo$Field) sess) user (.getParameter request "fb_sig_user") fql (.fql_query fbClient (str "SELECT name FROM user WHERE uid=" user)) ] (str (.notifications_send fbClient "hello NooPolis") (.notifications_sendEmailToCurrentUser fbClient "hello NooPolis" nil "hello NooPolis") "UserId:" ; (.getUserId sess) "
" fql "FirstName:" ; (.getFirstName userInfo) "
" )) (catch Exception e (str "Houston, we have a problem: " e))) ))) "
")) "")))) ;}}}