[UserScript] Peer review semi automatic bot

pepsicolaa
by pepsicolaa · 5 posts
3 years ago in Javascript
Posted 3 years ago · Author
Hello.

I just wrote a small imvu script making the peer review less painful.
Imvu started to remove access to peer review to account that were validating any items without checking, so that bot is not entirely autmatic, so you should pay attention and review the product before validating it. That bot automatically click on the "view in 3D" button and check the "No issues - product meets IMVU Virtual Goods Policy" by default.
Also, i noticed that for most items, we are forced to wait 25 seconds before sending the review result, which is bad considering that for most items, only around 5 seconds is really needed to review item, and if you do something else aside, you quickly forget about reviewing the products and you end up losing a lot of time, hence i also added a case "Submit when ready" in the bottom of the blue rectangle in peer review, if you check this case, it means that you reviewed the product before the time, and it will click on the button automatically after 25-35 seconds gap ( it is randomly generated to make sure you don't send the review result after 25 seconds, but it is probably useless, was just an extra safety). So this is more something to prevent you from forgetting about peer review for items simple to review.

You still have to review the product, it is important, as i said, imvu is banning people from peer review, so check the items and give it the real rating if you don't want to lose access to peer review, this bot only make you win some time by clicking on the button, checking the "no issues case" as it is in most of the case the one to pick, but if you notice something that is not fitting, just skip the product if you don't wish to flag it and let other people do it, or review it correctly and change the checked case to the right category.

I only tested on firefox with greasemonkey, but it should work with tampermonkey too for chromium browser ( chrome, edge, brave,... )
here is the code:
Code
// ==UserScript==
// @name     peer review bot
// @version  1
// @grant    GM.setValue
// @grant       GM.getValue
// @match     *://*.imvu.com/peer_review/*
// ==/UserScript==


function rand(min, max) {
    min = Math.ceil(min);
    max = Math.floor(max);
    return Math.floor(Math.random() * (max - min + 1)) + min;
}


function execute() {
    if (document.querySelector('#view_in_3d')) {
        document.querySelector('#view_in_3d').click();
    }
    document.querySelector('#cb_no_issues').click();

    setTimeout(() => {
        if (document.querySelector('#cbSubmit').checked) {
            document.querySelector('#btn_submit_vote').click();
        }
    }, rand(25000, 35000))
}


const createInput = (id) => {
    const x = document.createElement('input');
    x.setAttribute('type', 'checkbox');
    x.setAttribute('name', id);
    x.setAttribute('id', id);
    return x;
}

const createLabel = (elFor) => {
    const x = document.createElement('label');
    x.setAttribute('for', elFor);
    x.innerText = 'Submit when ready';
    return x;
}

const checkbox = createInput('cbSubmit');
const label = createLabel('cbSubmit');

document.querySelector('#btn_submit_vote').after(label);
document.querySelector('#btn_submit_vote').after(checkbox);

execute();


This bot is safe to use, if you get banned from peer review it means you rated products wrongly, hence i'm not responsable.

Installation step:
1. Install greasemonkey on firefox ( Or Tampermonkey on chrome/edge/brave )
2. Click on the Greasemonkey/tampermonkey icon on the browser topbar to open the menu
3. Select "New user script"
4. Copy/Paste the code posted above in the newly opened window
5. Save the script
6. Navigate to peer review (https://www.imvu.com/peer_review/)
7. Enjoy

If you have any problems or any suggestions to improve it, I'm open
Posted 3 years ago
Vary usefull Thank you so much for this tool ")

-- Sun Jul 04, 2021 8:39 pm --

If only there were a script to finish surveys faster :(
Posted 5 months ago
Code
// ==UserScript==
// @name     peer review bot2
// @version  1
// @grant    GM.setValue
// @grant    GM.getValue
// @match    *://*.imvu.com/peer_review/*
// ==/UserScript==

function rand(min, max) {
    min = Math.ceil(min);
    max = Math.floor(max);
    return Math.floor(Math.random() * (max - min + 1)) + min;
}

function execute() {
    if (document.querySelector('#open_in_classic') !== null) {
        document.querySelector('#open_in_classic').click();
    }
    document.querySelector('#lb_no_issues').click();

    setTimeout(() => {
        if (document.querySelector('#btn_submit_vote')) {
            document.querySelector('#btn_submit_vote').click();
        }
    }, rand(25000, 35000));
}

execute();

Open in Classic
Posted 5 months ago
@helana

Good work. I do have a couple minor suggestions to clean up the code a bit though.

I recommend storing the node returned by
document.querySelector('#open_in_classic')
in a variable rather than doing a lookup twice. Same for the node returned by
document.querySelector('#btn_submit_vote')
, especially since that one is in a loop.

Anyway, nicely done, should work flawlessly. How long have you been working with javascript?
Posted 5 months ago
@DataMine

your welcome i have other 2 i was trying it

-- Tue May 21, 2024 6:25 pm --

Code
// ==UserScript==
// @name     peer review bot3
// @version  1
// @grant    GM.setValue
// @grant    GM.getValue
// @match    *://*.imvu.com/peer_review/*
// @match    *://*.imvu.com/next/peer_review/*
// ==/UserScript==

function rand(min, max) {
    min = Math.ceil(min);
    max = Math.floor(max);
    return Math.floor(Math.random() * (max - min + 1)) + min;
}

function openAndSubmit() {
    var link = document.querySelector('a.peer-review-submit-button');

    if (link) {
        var url = link.href;
        var newTab = window.open(url, '_blank');
        newTab.onload = function() {
            setTimeout(function() {
                newTab.close();
            }, 2000); // Bekleme süresi (örneğin, 2 saniye)
        };
    } else {
        console.error("Link not found.");
    }
}

function openInNewWindow(buttonText) {
    // Düğmeleri içeriğine göre bulma
    var buttons = document.querySelectorAll('button span');
    buttons.forEach(function(element) {
        if (element.textContent.trim() === "View in 3D" || element.textContent.trim() === "3D görüntüle") {
            // Eğer düğme metni istenilen metinle aynıysa, tıklama işlemi gerçekleştir
            var button = element.parentNode;
            var url = button.getAttribute('onclick').match(/'([^']+)'/)[1];
            var newTab = window.open(url, '_blank');
            newTab.onload = function() {
                setTimeout(function() {
                    newTab.close();
                    document.querySelector('#lb_no_issues').click();
                    setTimeout(function() {
                        if (document.querySelector('#btn_submit_vote')) {
                            document.querySelector('#btn_submit_vote').click();
                        }
                    }, rand(5000, 10000));
                }, 23000); // Bekleme süresi (örneğin, 20 saniye)
            };
        }
    });
}

openInNewWindow("View in 3D");
its working just in english and if you have malware close all because new tab slowly loading

Create an account or sign in to comment

You need to be a member in order to leave a comment

Sign in

Already have an account? Sign in here

SIGN IN NOW

Create an account

Sign up for a new account in our community. It's easy!

REGISTER A NEW ACCOUNT