Extractor Button

Agrega un botón de extractor a https://www.xvideos.com/profileslist

当前为 2023-06-03 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @license MIT
// @name         Extractor Button
// @namespace    https://www.example.com
// @version      1.0
// @description  Agrega un botón de extractor a https://www.xvideos.com/profileslist
// @author       Tu Nombre
// @match        https://www.xvideos.com/profileslist
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // Función para mostrar la ventana de solicitud de palabras clave
    function showPrompt() {
        var keywords = prompt('Ingrese la palabra o grupo de palabras de interés:');
        if (keywords) {
            extractUsernames(keywords);
        }
    }

    // Función para extraer los nombres de usuario y verificar las palabras clave
    function extractUsernames(keywords) {
        var usernameElements = document.querySelectorAll('.profile-name a'); // Selector que apunta a los enlaces dentro de los elementos con la clase "profile-name"

        var matchingUsernames = [];

        for (var i = 0; i < usernameElements.length; i++) {
            var username = usernameElements[i].textContent.trim();

            // Verificar si el nombre de usuario contiene las palabras clave (ignorando mayúsculas y minúsculas)
            if (username.toLowerCase().includes(keywords.toLowerCase())) {
                matchingUsernames.push(username);
            }
        }

        if (matchingUsernames.length > 0) {
            var message = 'Nombres de usuario encontrados:\n\n' + matchingUsernames.join('\n');
            alert(message);
        } else {
            alert('No se encontraron nombres de usuario que coincidan con las palabras clave.');
        }
    }

    // Crear el botón
    var button = document.createElement('button');
    button.innerText = 'Extractor';

    // Estilo del botón
    button.style.position = 'fixed';
    button.style.top = '20px';
    button.style.right = '20px';
    button.style.zIndex = '9999';
    button.style.padding = '10px 20px';
    button.style.background = '#4285f4';
    button.style.color = 'white';
    button.style.border = 'none';
    button.style.borderRadius = '4px';
    button.style.cursor = 'pointer';

    // Agregar evento clic al botón
    button.addEventListener('click', showPrompt);

    // Agregar el botón al documento
    document.body.appendChild(button);
})();