Created
February 3, 2016 08:35
-
-
Save yinheli/e0c63bf3f148d912371a to your computer and use it in GitHub Desktop.
批量删除腾讯微博
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
// 批量删除广播 | |
(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); | |
}); | |
})(); |
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
// 批量删除收藏夹 | |
(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