Last active
August 26, 2019 16:32
-
-
Save euppi98/1d3ca3939f749b00459d39e46d5b5d06 to your computer and use it in GitHub Desktop.
ВК - библиотека скриптов (VK - script library)
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
| for (const button of document.querySelectorAll("button")) { | |
| if (button.textContent.includes("Добавить в друзья")) { | |
| button.click(); | |
| } | |
| } |
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
| //scroll down at max | |
| function scrollDown(callback) { | |
| let scroll = document.body.scrollHeight; | |
| let lastScroll = scroll; | |
| window.scrollTo(0, document.body.scrollHeight); | |
| requestAnimationFrame(function() { | |
| scroll = document.body.scrollHeight; | |
| if (scroll != lastScroll) | |
| scrollDown(callback); | |
| else callback(); | |
| }); | |
| } | |
| //add all music | |
| //setTimeout - 1000 ms = 1 second | |
| scrollDown(function() { | |
| var list = document.querySelectorAll(".audio_row"); | |
| console.log(`Total songs: ${list.length}`); | |
| function add(el, obj, delay) { | |
| setTimeout(function() { | |
| console.log(`add ${obj.title}`); | |
| AudioUtils.addAudio(el, obj); | |
| }, 1000 * delay); | |
| } | |
| list.forEach(function(el, num) { | |
| let obj = AudioUtils.asObject(AudioUtils.getAudioFromEl(el)); | |
| add(el, obj, num); | |
| }); | |
| }); |
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
| for (const button of document.querySelectorAll("button")) { | |
| if (button.textContent.includes("Отписаться")) { | |
| button.click(); | |
| } | |
| } | |
| for (const button of document.querySelectorAll("button")) { | |
| if (button.textContent.includes("Отменить заявку")) { | |
| button.click(); | |
| } | |
| } |
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
| var bl_list = document.querySelectorAll('.settings_bl_row'), | |
| i; | |
| function iterateBlocked() { | |
| if (!bl_list.length) return; | |
| for (i = 0; i < bl_list.length; i++) { | |
| if (bl_list[i]) { | |
| removeBlockedFan(i); | |
| } | |
| }; | |
| } | |
| function removeBlockedFan(id) { | |
| var remove_control = bl_list[id].getElementsByTagName('a')[1]; | |
| remove_control.click(); | |
| } | |
| iterateBlocked(); |
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
| //scroll down at max | |
| function scrollDown(callback) { | |
| let scroll = document.body.scrollHeight; | |
| let lastScroll = scroll; | |
| window.scrollTo(0, document.body.scrollHeight); | |
| requestAnimationFrame(function() { | |
| scroll = document.body.scrollHeight; | |
| if (scroll != lastScroll) | |
| scrollDown(callback); | |
| else callback(); | |
| }); | |
| } | |
| //delete all music | |
| scrollDown(function() { | |
| var list = document.querySelectorAll(".audio_row"); | |
| console.log(`Total songs: ${list.length}`); | |
| function del(obj) { | |
| console.log(`delete ${obj.title}`); | |
| ajax.post("al_audio.php", { | |
| act: "delete_audio", | |
| oid: obj.ownerId, | |
| aid: obj.id, | |
| hash: obj.deleteHash, | |
| restore: 1 | |
| }); | |
| } | |
| list.forEach(function(el) { | |
| let obj = AudioUtils.asObject(AudioUtils.getAudioFromEl(el)); | |
| del(obj); | |
| }); | |
| }); |
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
| for (const button of document.querySelectorAll("button")) { | |
| if (button.textContent.includes("Оставить в подписчиках")) { | |
| button.click(); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment