Extractor Button

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

目前為 2023-06-03 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 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);
})();