Extractor Button

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

Från och med 2023-06-03. Se den senaste versionen.

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 or Violentmonkey 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==
// @license MIT
// @name         Extractor Button
// @namespace    https://www.example.com
// @version      1.0.2
// @description  Agrega un botón de extractor a https://www.xvideos.com/profileslist
// @author       Daniel
// @match        https://www.xvideos.com/profileslist
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // Función para mostrar los resultados
    function showResults(usernames, aboutMe) {
        var container = document.createElement('div');
        container.style.position = 'fixed';
        container.style.top = '20px';
        container.style.right = '20px';
        container.style.zIndex = '9999';
        container.style.background = '#fff';
        container.style.padding = '10px';
        container.style.border = '1px solid #ccc';
        container.style.borderRadius = '4px';
        container.style.boxShadow = '0 2px 4px rgba(0,0,0,0.1)';
        container.style.fontFamily = 'Arial, sans-serif';
        container.style.fontSize = '14px';

        var usernameTitle = document.createElement('h3');
        usernameTitle.textContent = 'Nombres de usuario encontrados:';
        container.appendChild(usernameTitle);

        var usernameList = document.createElement('ul');
        usernames.forEach(function(username) {
            var listItem = document.createElement('li');
            listItem.textContent = username;
            usernameList.appendChild(listItem);
        });
        container.appendChild(usernameList);

        var aboutMeTitle = document.createElement('h3');
        aboutMeTitle.textContent = 'About Me encontrados:';
        container.appendChild(aboutMeTitle);

        var aboutMeList = document.createElement('ul');
        aboutMe.forEach(function(text) {
            var listItem = document.createElement('li');
            listItem.textContent = text;
            aboutMeList.appendChild(listItem);
        });
        container.appendChild(aboutMeList);

        document.body.appendChild(container);
    }

    // Función para extraer los datos y verificar las palabras clave
    function extractData(usernameKeywords, aboutMeKeywords) {
        var profileElements = document.querySelectorAll('.thumb-block-profile');

        var matchingUsernames = [];
        var matchingAboutMe = [];

        for (var i = 0; i < profileElements.length; i++) {
            var profileElement = profileElements[i];
            var usernameElement = profileElement.querySelector('.profile-name a');
            var aboutMeElement = profileElement.querySelector('.profile-aboutme-content p');

            if (usernameElement && aboutMeElement) {
                var username = usernameElement.textContent.trim();
                var aboutMe = aboutMeElement.textContent.trim();

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

                // Verificar si el "about me" contiene las palabras clave (ignorando mayúsculas y minúsculas)
                if (aboutMe.toLowerCase().includes(aboutMeKeywords.toLowerCase())) {
                    matchingAboutMe.push(aboutMe);
                }
            }
        }

        if (matchingUsernames.length > 0 || matchingAboutMe.length > 0) {
            showResults(matchingUsernames, matchingAboutMe);
        }
    }

    // Crear el formulario
    var formContainer = document.createElement('div');
    formContainer.style.position = 'fixed';
    formContainer.style.top = '20px';
    formContainer.style.right = '20px';
    formContainer.style.zIndex = '9999';
    formContainer.style.display = 'flex';

    var usernameInput = document.createElement('input');
    usernameInput.placeholder = 'Palabras clave para nombres de usuario';
    usernameInput.style.marginRight = '10px';
    formContainer.appendChild(usernameInput);

    var aboutMeInput = document.createElement('input');
    aboutMeInput.placeholder = 'Palabras clave para "about me"';
    formContainer.appendChild(aboutMeInput);

    var extractButton = document.createElement('button');
    extractButton.innerText = 'Extractor';
    extractButton.style.background = '#4285f4';
    extractButton.style.color = 'white';
    extractButton.style.border = 'none';
    extractButton.style.borderRadius = '4px';
    extractButton.style.padding = '10px 20px';
    extractButton.style.cursor = 'pointer';
    formContainer.appendChild(extractButton);

    extractButton.addEventListener('click', function() {
        var usernameKeywords = usernameInput.value.trim();
        var aboutMeKeywords = aboutMeInput.value.trim();

        if (usernameKeywords && aboutMeKeywords) {
            extractData(usernameKeywords, aboutMeKeywords);
        }
    });

    // Agregar el formulario al documento
    document.body.appendChild(formContainer);
})();