Created
November 29, 2010 22:20
-
-
Save fons/720749 to your computer and use it in GitHub Desktop.
social-graph-search
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
(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)) |
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
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> |
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
(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