This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn get-name [fb-uid] | |
(with-facebook (make-facebook-connection "myapikey" "mysecret") | |
(fql-query (str "SELECT name FROM users WHERE uid=" fb-uid)))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn call-method [method params] | |
...POST request...) | |
(defn apify-method [call-sym] | |
(let [call (name call-sym) | |
call-sp (.split call "-") | |
class (first call-sp) | |
method1 (first (rest call-sp)) | |
method (if (< 1 (count call-sp)) | |
(rest (rest call-sp)) ())] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn friends-are-friends [uids1 uid2] | |
(call-method "facebook.friends.areFriends" | |
{:uids1 uids1 :uids2 uids2})) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(use '(com.mongodb ObjectId)) | |
(prn (. (ObjectId.) toString))) | |
"4c0800a583009bdc2bd8d166" | |
---- | |
(defmethod print-dup com.mongodb.ObjectId [o w] | |
(.write w (format "#^com.mongodb.ObjectId (com.mongodb.ObjectId. \"%s\")" (. o toString)))) |