Created
June 16, 2017 05:33
-
-
Save naoyeye/a51ec7c58c4f077e437f78b2d3255b31 to your computer and use it in GitHub Desktop.
扇贝中搜索特定的某个同桌申请者
This file contains hidden or 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
var count = 1 | |
var got = false | |
function searchYou() { | |
$.ajax({ | |
'url': 'https://www.shanbay.com/api/v2/deskmate/userinfos/?page=' + count + '&ipp=10', | |
'success': function(resp) { | |
var list = resp.data.objects | |
if (!list.length) { | |
console.log('没了额') | |
return | |
} | |
for (var i = list.length - 1; i >= 0; i--) { | |
if (list[i].user_profile.user.nickname === 's▼' || list[i].user_profile.user.user_name === 'siiiiiiiiiii') { | |
console.log('找到了', list[i]) | |
got = true | |
} | |
} | |
if (!got) { | |
count = count + 1; | |
console.log('没找到,继续') | |
setTimeout(function() { | |
searchYou() | |
}, 1000) | |
} | |
} | |
}) | |
} | |
searchYou() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment