Conector Automático LinkedIn

Automatiza conexões e expande sua rede profissional de forma eficiente.

👇 Arraste para a Barra de Favoritos 👇

🚀 Conectar Auto

Como usar:

  1. Acesse a Busca: Vá para a página de pesquisa de "Pessoas" no LinkedIn (ex: procure "Power Platform").
  2. Clique no Favorito: Na barra de favoritos, clique no botão que você acabou de instalar.
  3. Aguarde: O script irá percorrer as páginas conectando automaticamente. Mantenha a aba aberta.
📜 Código-Fonte (Para Validação Técnica)

// --- SCRIPT DE AUTOMAÇÃO 1.0 (Validado v12) ---

async function runAutomation() {
    const MAX_TOTAL = 150;        // Limite total de conexões
    const DELAY_CONN = 2500;      // Pausa entre conexões (ms)
    const DELAY_PAGE = 4500;      // Pausa longa ao tentar mudar de página
    const MAX_EMPTY_PAGES = 100;  // Tolerância de páginas vazias consecutivas
    
    // --- INTERFACE VISUAL ---
    const ui = document.createElement('div');
    ui.style.cssText = "position:fixed;top:10px;right:10px;z-index:999999;background:#0a66c2;color:white;padding:12px 20px;border-radius:24px;box-shadow:0 4px 12px rgba(0,0,0,0.3);font-family:system-ui,sans-serif;font-weight:bold;font-size:14px;cursor:pointer;";
    ui.innerText = "🤖 Iniciando Automação...";
    document.body.appendChild(ui);
    
    const log = (msg, color) => {
        ui.style.backgroundColor = color || ui.style.backgroundColor;
        ui.innerText = msg;
        console.log("[Auto]", msg);
    };

    const sleep = ms => new Promise(r => setTimeout(r, ms));
    
    // Funções de Destaque
    const highlight = (el, color="red") => { el.style.border="3px solid "+color; el.style.boxShadow="0 0 10px "+color; };
    const unhighlight = (el) => { el.style.border="none"; el.style.boxShadow="none"; };

    if(!window.location.host.includes("linkedin.com")) { 
        alert("Execute este script apenas no LinkedIn!"); 
        ui.remove(); return; 
    }

    try {
        log("🚀 Rodando...", "#0a66c2");
        await sleep(1000);
        let sent = 0; let emptyPages = 0; let running = true;
        
        ui.onclick = () => { running = false; log("🛑 Parando...", "#d11124"); };
        ui.title = "Clique para PARAR";

        while(running && sent < MAX_TOTAL) {
            if(emptyPages >= MAX_EMPTY_PAGES) { alert("Parando: Muitas páginas sem resultados."); break; }

            // --- SCROLL OBRIGATÓRIO (Carrega Rodapé) ---
            window.scrollTo({ top: document.body.scrollHeight, behavior: 'smooth' });
            await sleep(2000);
            
            // --- IDENTIFICAR PERFIS 'CONECTAR' ---
            const btns = Array.from(document.querySelectorAll('button')).filter(b => {
                const t = (b.innerText || b.getAttribute('aria-label') || "").toLowerCase();
                return (t.includes('conectar') || t.includes('connect')) && 
                       !b.disabled && 
                       !t.includes('seguindo') && !t.includes('message');
            });

            log(`📄 Página atual: ${btns.length} conexões`, "#e7a33e");
            
            if(btns.length > 0) {
                emptyPages = 0; 
                for(const btn of btns) {
                    if(!running || sent >= MAX_TOTAL) break;
                    try {
                        const card = btn.closest('.entity-result__item') || btn.closest('li') || btn;
                        card.scrollIntoView({block: "center", behavior: "smooth"}); 
                        highlight(card, "#d11124"); 
                        await sleep(1000); 

                        btn.click();
                        await sleep(1000);
                        highlight(card, "#057642"); 
                        
                        if(document.querySelector('h2#ip-fuse-limit-alert__header')) { 
                            alert("Aviso do LinkedIn: Limite Semanal Atingido!"); 
                            running=false; break; 
                        }

                        // Enviar 'Sem Nota'
                        const send = Array.from(document.querySelectorAll('button span.artdeco-button__text')).find(s => {
                            const t = s.innerText.toLowerCase();
                            return t.includes('sem nota') || t.includes('without') || t === 'enviar' || t === 'send';
                        });

                        if(send) { 
                            send.closest('button').click(); 
                            await sleep(800); 
                        } else { 
                            const c = document.querySelector('button[aria-label="Dismiss"]'); 
                            if(c) c.click(); 
                        }
                        
                        await sleep(500); unhighlight(card); 
                        sent++; 
                        log(`✅ Enviados: ${sent}`, "#057642"); 
                        await sleep(DELAY_CONN);
                    } catch(e) {}
                }
            } else { emptyPages++; }

            if(!running || sent >= MAX_TOTAL) break;

            // --- PAGINAÇÃO (Snippet v12) ---
            log("📜 Buscando próxima página...", "#0a66c2");
            window.scrollTo({ top: document.body.scrollHeight, behavior: 'smooth' });
            await sleep(2000);

            let nextBtn = null;

            // A: Classe exata
            if(!nextBtn) nextBtn = document.querySelector('button.artdeco-pagination__button--next');
            
            // B: Texto "Avançar" exato (trimado)
            if(!nextBtn) {
                const spans = Array.from(document.querySelectorAll('span.artdeco-button__text'));
                const match = spans.find(s => {
                    const t = s.innerText.trim().toLowerCase();
                    return t === 'avançar' || t === 'next';
                });
                if(match) nextBtn = match.closest('button');
            }

            // C: Aria-Label e IDs
            if(!nextBtn) nextBtn = document.querySelector('button[aria-label="Avançar"], button[aria-label="Next"]');
            if(!nextBtn) nextBtn = document.querySelector('button[id^="ember"].artdeco-pagination__button');

            if (nextBtn && !nextBtn.disabled) {
                nextBtn.scrollIntoView({block: "center", behavior: "smooth"});
                await sleep(1000);
                nextBtn.click();
                await sleep(DELAY_PAGE);
            } else {
                // Fallback: Botões Numéricos
                const pages = document.querySelectorAll('.artdeco-pagination__indicator--number button');
                if (pages.length > 0) {
                    log("⚠️ Tentando paginação numérica...", "#e7a33e");
                    pages[pages.length - 1].click();
                    await sleep(DELAY_PAGE);
                } else {
                    running = false;
                    log("🏁 Fim das páginas.", "#333");
                    alert("Fim das páginas disponíveis.");
                }
            }
        }
    } catch(e) { 
        alert("Erro Crítico: " + e.message); 
    } finally { 
        setTimeout(() => ui.remove(), 8000); 
    }
}