LinkedIn Auto Connect

Envia automaticamente solicitações de conexão na página "Minha rede" do LinkedIn

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         LinkedIn Auto Connect
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  Envia automaticamente solicitações de conexão na página "Minha rede" do LinkedIn
// @author       Lorenzo
// @match        https://www.linkedin.com/mynetwork/*
// @icon         https://www.linkedin.com/favicon.ico
// @grant        none
// ==/UserScript==

(function () {
    'use strict';

    console.log('[LinkedIn Auto Connect] Iniciado');

    function autoConnect() {
        // Clica nos botões "Conectar" ou "Convidar"
        const buttons = [...document.querySelectorAll('button')]
            .filter(btn =>
                btn.innerText.includes('Conectar') || btn.innerText.includes('Convidar')
            );

        if (buttons.length === 0) {
            console.log('[LinkedIn Auto Connect] Nenhum botão "Conectar" encontrado.');
        } else {
            buttons.forEach((btn, i) => {
                setTimeout(() => {
                    console.log(`[LinkedIn Auto Connect] Clicando no botão ${i + 1}: ${btn.innerText}`);
                    btn.click();

                    // Espera o popup aparecer e clica em "Enviar"
                    setTimeout(() => {
                        const sendBtn = [...document.querySelectorAll('button')].find(b =>
                            b.innerText.includes('Enviar')
                        );
                        if (sendBtn) {
                            console.log('[LinkedIn Auto Connect] Confirmando envio.');
                            sendBtn.click();
                        }
                    }, 1000);
                }, i * 2500); // 2.5 segundos entre cada clique
            });
        }

        // Faz scroll para carregar mais perfis
        window.scrollBy(0, 1000);
    }

    // Executa a cada 10 segundos
    setInterval(autoConnect, 10000);
})();