Skip to content

Instantly share code, notes, and snippets.

@smathy
Created August 8, 2011 17:18
Show Gist options
  • Save smathy/1132218 to your computer and use it in GitHub Desktop.
Save smathy/1132218 to your computer and use it in GitHub Desktop.
huntMen : function(buffy) {
var soulmates = [];
while (soulmates.length < 10) {
// Get 10 candidates for Buffy
getMatches( buffy, 10, function(userids) {
for (var i = 0; i < userids.length; i++) {
var u = userids[i];
// get their pic from our pic server
getThumbnail( u, function(thumb) {
isPicVampire( thumb, function(is_vamp) {
if (! is_vamp) {
getPersonality( u, function(personality) {
getLastTalked( u, match, function(last_talked) {
soulmates.push({
"userid" : match,
"thumb" : thumb,
"last_talked" : last_talked,
"personality" : personality
});
});
});
}
});
});
}
});
}
//
// Our function can now continue to do
// whatever it wants with
// soulmates...
//
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment