Browse files

turn off entities fpr lookup-user

  • Loading branch information...
fons committed Oct 31, 2011
1 parent 2d335ed commit 8ff7f241adc4f5f834d75793c46faf0d412d6b56
Showing with 8 additions and 5 deletions.
  1. +2 −2 api/twitter-cache.lisp
  2. +4 −1 api/twitter-user.lisp
  3. +2 −2 db/mongodb-driver.lisp
@@ -71,8 +71,8 @@
(setf (gethash (twitter-user-screen-name user) (twitter-object-cache 'twitter-user)) user)
(db-store-object user lisprec))))
-(defmacro drop-cache (type)
- `(remhash (quote ,type) *twitter-object-cache*))
+(defun drop-cache (type)
+ (remhash type *twitter-object-cache*))
(defmethod lookup-twitter-object ((ref (eql 'twitter-user)) (lisprec cons))
(let ((name (cl-twitter::get-value :screen-name lisprec)))
@@ -173,7 +173,10 @@
(define-twitter-method show-user ((screen-name) &key (user-id nil) (include-entities t)) :users/show :screen_name)
(define-twitter-method show-user-by-id ((user-id) &key (screen-name nil) (include-entities t)) :users/show :user_id)
;; probably should built in some resiliency in that the user can pass in a list ??
-(define-twitter-method lookup-users ((screen-name) &key (user-id nil) (include-entities t)) :users/lookup :screen-name)
+;; keep entities turned off until you can handle this in the object creation.
+;; i see that if an other user is mentioned in the tweets, the entities will contain those ids and those are comming back decoded (i.e as the response)
+;; maybe that's a feature !!
+(define-twitter-method lookup-users ((screen-name) &key (user-id nil) (include-entities nil)) :users/lookup :screen-name)
;; does the query need to be url encoded ????
;; used url-rewrite for encoding; gets same result set as twitter for simple name queries..
(define-twitter-method search-users ((query) &key (per-page nil) (page nil) (include-entities t) ) :users/search :q )
@@ -50,7 +50,7 @@
(nreverse lst)))
(defun decode-to-hash-table (lst)
- (let ((ht (make-hash-table :test 'equal)))
+ (let ((ht (make-hash-table :test 'equal)))
(labels ((assocp (lst)
(and (consp lst) (consp (car lst)) (symbolp (car (car lst)))))
(item-listp (lst)
@@ -68,7 +68,7 @@
(t (add (car el) (cdr el)))))
-;; IMPORTANT : use 'safe mode' i.e chech get-last-error before continuing....
+;; IMPORTANT : use 'safe mode' i.e check get-last-error before continuing....
(defmacro store-twitter-object (type)

0 comments on commit 8ff7f24

Please sign in to comment.