Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save whtsky/adc4daef8771b9c8db4c05b6b2dea230 to your computer and use it in GitHub Desktop.
Save whtsky/adc4daef8771b9c8db4c05b6b2dea230 to your computer and use it in GitHub Desktop.
批量删除腾讯微博
// 批量删除广播
function ff(){
var list = $$('#talkList>li');
var count = list.length
console.log('list length', count);
var t = 0
var idx = 0
list.forEach(function(i){
setTimeout(function() {
console.log("delete id", i.id, 'idx:', idx++);
MI.ajax({
url: 'http://api.t.qq.com/old/delete.php',
type: 'post',
data: {
id: i.id,
g_tk:MI.random()
},
success: function(d) {
console.log(d);
if (idx == count) {
console.log('finished');
window.location.reload();
setTimeout(ff, 3000);
}
}
})
}, t+=1000);
});
}
ff();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment