Skip to content

Instantly share code, notes, and snippets.

@fons
Created November 29, 2010 22:20
Show Gist options
  • Save fons/720749 to your computer and use it in GitHub Desktop.
Save fons/720749 to your computer and use it in GitHub Desktop.
social-graph-search
(defun collect-followers (screen-name)
(let ((lst))
(labels ((collect-it (l)
(setf lst (nconc lst l))))
(with-cursor (:collector #'collect-it :test #'rate-limit-exceeded ) (follower-ids screen-name))) lst))
(defun collect-friends (screen-name)
(let ((lst))
(labels ((collect-it (l)
(setf lst (nconc lst l))))
(with-cursor (:collector #'collect-it :test #'rate-limit-exceeded ) (friend-ids screen-name))) lst))
CL-USER> (rate-limit-status)
#<TWITTER-RATE-LIMIT '139:150'>
CL-USER> (length (collect-followers "sarahpalinusa"))
318181
CL-USER> (rate-limit-status)
#<TWITTER-RATE-LIMIT '75:150'>
CL-USER>
(defun friend-ids (screen-name &key (cursor -1))
(apply 'twitter-op :friends/ids :screen-name screen-name :cursor cursor nil ))
(defun follower-ids (screen-name &key (cursor -1))
(apply 'twitter-op :followers/ids :screen-name screen-name :cursor cursor nil ))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment