Greasy Fork is available in English.

Discussions » Creation Requests

looking for a script to click all follow buttons on a page triggert by a key combination or a button

§
Posted:
Edited:

looking for a script to click all follow buttons on a page triggert by a key combination or a button

hey guys i am fairly new to all this, i am looking for a way to click all follow buttons on a site with a key combination (like strg+alt+f) or a button that is shown on the page that i can click to click all buttons at once.

this would be a site it should work on: https://www.manyvids.com/Social/NaughtySasha_/1003656409/Followers/

i found some examles of how to do stuff like that with document.getElementByClassName but could not get it to work what so ever. and other stuf based on a button ID, but i guess i am too new to all this to figure it out on my own.

as far as i was able to figure it out, this would be the code of one of those follow buttons:

<div data-v-42a41569="" data-v-4bcc15e9="" class="mv-follow-button mv-follow-button"><button data-v-3e139dc8="" data-v-42a41569="" class="mv-button primary rounded outlined"> Follow </button></div>

can anyone help me, i am loosing my mind over this

§
Posted:

clicking them automatically when the script is active, as they apear while loading the site further, would be ok too.

§
Posted:

it is a little bit of an urgent thing, could please someon help ? :'(

§
Posted:

not a difficult thing but it's not a good idea to click all button at one time as you may block by the site, anyway the follow code is not tested

// ==UserScript==
// @name         Follow all Follower
// @namespace    www.manyvids.com
// @version      0.1
// @description  try to take over the world!
// @include      https://www.manyvids.com/*/Followers/
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    //by press 'Shift+Alt+F'
    document.body.addEventListener('keydown',ev=>ev.code=='KeyF'&&ev.altKey&&ev.shiftKey&&Array.from(document.querySelectorAll('button.mv-button.primary.rounded.outlined')).forEach(item=>item.click()))
})();
§
Posted:
Edited:

thank you so much. it actually worked. you are my hero. and saved my week. :)

§
Posted:
Edited:

now i checked. and it only follows the first one the others are marked as following, but don't follow. is there a way to put in a little delay between the single clicks ? i guess the site can't handly so many instant clicks. something like 1000ms after each click

§
Posted:

can anyone help with the delay between each button click ?

§
Posted:

anyway this is not tested also. I cannot receive notice unless you click Quote button on my reply

// ==UserScript==
// @name         Follow all Follower
// @namespace    www.manyvids.com
// @version      0.2
// @description  try to take over the world!
// @include      https://www.manyvids.com/*/Followers/
// @grant        none
// ==/UserScript==
(function() {
    'use strict';
    let buttons;

    function click() {
        if (buttons.length) {
            buttons.shift().click();
            setTimeout(click,500); //delay 500ms and click the next one
        }
    }

    document.body.addEventListener('keydown',ev=>{
        //by press 'Shift+Alt+F'
        if (ev.code=='KeyF'&&ev.altKey&&ev.shiftKey) {
            buttons = Array.from(document.querySelectorAll('button.mv-button.primary.rounded.outlined'));
            click();
        };
    })
})();
§
Posted:

@indefined said: anyway this is not tested also. I cannot receive notice unless you click Quote button on my reply

// ==UserScript==
// @name         Follow all Follower
// @namespace    www.manyvids.com
// @version      0.2
// @description  try to take over the world!
// @include      https://www.manyvids.com/*/Followers/
// @grant        none
// ==/UserScript==
(function() {
    'use strict';
    let buttons;

    function click() {
        if (buttons.length) {
            buttons.shift().click();
            setTimeout(click,500); //delay 500ms and click the next one
        }
    }

    document.body.addEventListener('keydown',ev=>{
        //by press 'Shift+Alt+F'
        if (ev.code=='KeyF'&&ev.altKey&&ev.shiftKey) {
            buttons = Array.from(document.querySelectorAll('button.mv-button.primary.rounded.outlined'));
            click();
        };
    })
})();

amazing. it works, thank you so so much

Post reply

Sign in to post a reply.