Skip to content

Instantly share code, notes, and snippets.

@yinheli
Created February 3, 2016 08:35
Show Gist options
  • Save yinheli/e0c63bf3f148d912371a to your computer and use it in GitHub Desktop.
Save yinheli/e0c63bf3f148d912371a to your computer and use it in GitHub Desktop.
批量删除腾讯微博
// 批量删除广播
(function(){
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();
}
}
})
}, t+=10);
});
})();
// 批量删除收藏夹
(function(){
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/asyn/favoritemsg.php',
type: 'post',
data: {
id: i.id,
op: 2,
g_tk:MI.random()
},
success: function(d) {
console.log(d);
if (idx == count) {
console.log('finished');
window.location.reload();
}
}
})
}, t+=10);
});
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment