Last active
August 29, 2015 14:18
-
-
Save fpaint/971034076a073870982b to your computer and use it in GitHub Desktop.
Vk Chat cleanup
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
| (function(){ | |
| function chat_cleanup(chat_id, blacklist) { | |
| var keep = [], reg_magic = /kickChatMember\((\d+), (\d+), '(\w+)', intval\(\d\), '.*?', '(.*?)'\)/g, match; | |
| ajax.post('al_im.php', {act:'a_show_members_box', al: '1', chat: chat_id}, {onDone: function(title, text) { | |
| while(match = reg_magic.exec(text)) { | |
| var chat = match[1], mid = match[2], hash = match[3], user = match[4]; | |
| if(blacklist.indexOf(user)>=0) { | |
| console.log('Kick %s %s %s from chat %s', user, mid, hash, chat); | |
| ajax.post('al_im.php', extend({act: 'a_kick_user', chat: chat, hash: hash, mid: mid})); | |
| } else {keep.push(user);} | |
| } | |
| console.log(keep); | |
| }}); | |
| return; | |
| } | |
| var chat_id = location.href.match(/sel=c(\d+)/)[1]; | |
| if(chat_id) { | |
| var blacklist = ['Анну Васильеву', 'Виктора Губанова', 'Альфариуса Омегона', 'Альфария Омегона', 'Угнетающаю Депрессию', 'Нюту Семёнову', 'Алекса Гордона', 'Angel Exterminatus', 'Васю Сидорова', 'Оранжевыя Мандарина', 'Чёрныя Всадника', 'Mizuki Rei']; | |
| chat_cleanup(chat_id, blacklist); | |
| } | |
| }()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment