Skip to content

Instantly share code, notes, and snippets.

@GZShi
Last active August 29, 2015 14:05
Show Gist options
  • Save GZShi/83d5bb35aa6cd968c553 to your computer and use it in GitHub Desktop.
Save GZShi/83d5bb35aa6cd968c553 to your computer and use it in GitHub Desktop.
web qq 自动消息
// 1. 打开 http://w.qq.com
// 2. 登录
// 3. 选择交谈对象
// 4. 进入控制台
// 5. 粘贴运行
// 6. Chrome
(function () {
var textNode = $('#chat_textarea');
var sendBtn = $('#send_chat_btn');
var getMsg = (function () {
var seq = 1;
var text = [
'让我刷一下等级',
'一会就好',
'[流泪]',
'[大哭]',
'[擦汗]',
'[亲亲]',
'哈哈哈哈',
'赞~',
'根本停不下来',
'跪了',
'GGGGG'
];
function prefix() {
return '[' + seq++ + ']' /*+ '[' + Date.now() + ']'*/;
}
return function () {
return prefix() + text[Math.floor(Math.random() * text.length)];
}
})();
function send(times) {
if(times-- <= 0) return ;
textNode.value = getMsg();
sendBtn.click();
setTimeout(send, 100, times); // 间隔 100ms。请注意频率…
console.log('剩下' + times + '待发');
}
send(500); // 500次。请注意次数。珍爱生命
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment