newstlastlist / GuruShots-auto-Voter

GuruShots free fills
35 stars 15 forks source link

Script is auto joining challenges - after fix on issue 10. #16

Open mshonak opened 3 years ago

mshonak commented 3 years ago

hi all after the fix on this issue : https://github.com/newstlastlist/GuruShots-auto-Voter/issues/10 people was happy that it is working again and few say it is joining challenges automatically , I didn't notice about this because I am join all the challenges by myself as soon as they available and same time it join challenge and I was doing good with the picture the site pick for me , but when it picks not relevent picture it cost me swap . can same one try to make fix for this issue . Thanks .

maatt commented 3 years ago

hi all after the fix on this issue : #10 people was happy that it is working again and few say it is joining challenges automatically , I didn't notice about this because I am join all the challenges by myself as soon as they available and same time it join challenge and I was doing good with the picture the site pick for me , but when it picks not relevent picture it cost me swap . can same one try to make fix for this issue . Thanks .

https://github.com/maatt/GuruShots-auto-Voter/blob/master/GuruShitsAutoLike.js

give this a try and let me know.

sbursik commented 3 years ago

Testing now. The auto joining happens frequently for me so I should have a response in a day or so. Thank you.

mshonak commented 3 years ago

Try this but it stop after few challenge voting ( like the old script did - I usally ran it again and again until it done with different challenge sort ) so I will try it few more time and let you know if it is not join challenge automatically .

I notice it open small on the browser and had bottom like it run on phone. and your script have this code " const iPhone = devices['iPhone X'] " ) can I run your script on smartphone ? and how can I do it ?

I saw also this > https://gurushotautovoter.xyz/ working very nice - good job and well done :-) :-) :-)

mshonak commented 3 years ago

I disable the boost and the phone part , it ran all the way up to the end - but no new ofer to join challeng so the script done. I will check it again in the next days Thanks

//#############################################// // Want to Vote on an individual challenge? // // https://gurushotautovoter.xyz // // Add button to bookmarks // //#############################################//

const puppeteer = require('puppeteer');

//const devices = puppeteer.devices; //const iPhone = devices['iPhone X'];

async function main() { const browser = await puppeteer.launch({ headless: false, dumpio: false, devtools: false });

const page = await browser.newPage();
//await page.emulate(iPhone);
await page.setViewport({width: 1200, height: 720})
await page.goto('https://gurushots.com/', {waitUntil: 'networkidle0'});
const login = '#dialogContent_0 > md-dialog-content > form > div:nth-child(1) > input';
const password = '#dialogContent_0 > md-dialog-content > form > div:nth-child(2) > input';
const loginSubmit = '#dialogContent_0 > md-dialog-content > form > button'

const CREDS = require('./LoginData');
await page.evaluate(async () => {
    const loginBtn = document.querySelectorAll('mobile-header-empty > div > protection:nth-child(1) div');
    for (var btn of loginBtn) {
        const style = getComputedStyle(btn);

        if (style.display !== 'none') {
            await btn.click();
            break;
        }
    }

})

await page.waitForTimeout(2000);
await page.click(login);
await page.waitForTimeout(300);
await page.keyboard.type(CREDS.login);
await page.waitForTimeout(300);
await page.click(password);
await page.keyboard.type(CREDS.password);
await page.click(loginSubmit);
await page.waitForNavigation();

await page.waitForTimeout(7000);

await page.evaluate(async () => {
    const LetsGo = document.getElementsByClassName('modal-vote__greeting');
    const voteBtns = document.getElementsByClassName('icon-vote-negative');
    const boostBtns = document.getElementsByClassName('boost-state-available');

    for (var btn of voteBtns) {
        if (btn.closest('challenges-item-mobile')) {
            $(btn).click();
            await new Promise(resolve => setTimeout(resolve, 4000));
            $(LetsGo).click();
            const picForVote = $(".modal-vote__photo__voted").prev();

            if (picForVote.length === 0) {
                $('div[ng-click="$ctrl.submit()"]').click();
                await new Promise(resolve => setTimeout(resolve, 4000));
                $('div[ng-click="$ctrl.close()"]').click();
                await new Promise(resolve => setTimeout(resolve, 4000));
                continue;

            } else {
                await picForVote.each(function (i, el) {
                    r = Math.random();
                    if (i >= 20 && r > 0.2) {
                        $(el).click();
                    }
                });
                await new Promise(resolve => setTimeout(resolve, 4000));
                $('div[ng-click="$ctrl.submit()"]').click();
                await new Promise(resolve => setTimeout(resolve, 4000));
                $('div[ng-click="$ctrl.close()"]').click();
                await new Promise(resolve => setTimeout(resolve, 4000));
            }
        }

      //  if (boostBtns.length >= 1) {
        //    for (var btn of boostBtns) {
           //     $(btn).click();
          //    await new Promise(resolve => setTimeout(resolve, 4000));
           //    const picForVote = document.querySelector('div.c-modal-boost__photos > div:nth-child(1)');
          //     $(picForVote).click();
          //    await new Promise(resolve => setTimeout(resolve, 4000));

         //  }

      //  }
    }
});
await console.log('Voting Done');
await browser.close();

}

main();

maatt commented 3 years ago

I disable the boost and the phone part , it ran all the way up to the end - but no new ofer to join challeng so the script done. I will check it again in the next days Thanks

//#############################################// // Want to Vote on an individual challenge? // // https://gurushotautovoter.xyz // // Add button to bookmarks // //#############################################//

const puppeteer = require('puppeteer');

//const devices = puppeteer.devices; //const iPhone = devices['iPhone X'];

async function main() { const browser = await puppeteer.launch({ headless: false, dumpio: false, devtools: false });

const page = await browser.newPage();
//await page.emulate(iPhone);
await page.setViewport({width: 1200, height: 720})
await page.goto('https://gurushots.com/', {waitUntil: 'networkidle0'});
const login = '#dialogContent_0 > md-dialog-content > form > div:nth-child(1) > input';
const password = '#dialogContent_0 > md-dialog-content > form > div:nth-child(2) > input';
const loginSubmit = '#dialogContent_0 > md-dialog-content > form > button'

const CREDS = require('./LoginData');
await page.evaluate(async () => {
    const loginBtn = document.querySelectorAll('mobile-header-empty > div > protection:nth-child(1) div');
    for (var btn of loginBtn) {
        const style = getComputedStyle(btn);

        if (style.display !== 'none') {
            await btn.click();
            break;
        }
    }

})

await page.waitForTimeout(2000);
await page.click(login);
await page.waitForTimeout(300);
await page.keyboard.type(CREDS.login);
await page.waitForTimeout(300);
await page.click(password);
await page.keyboard.type(CREDS.password);
await page.click(loginSubmit);
await page.waitForNavigation();

await page.waitForTimeout(7000);

await page.evaluate(async () => {
    const LetsGo = document.getElementsByClassName('modal-vote__greeting');
    const voteBtns = document.getElementsByClassName('icon-vote-negative');
    const boostBtns = document.getElementsByClassName('boost-state-available');

    for (var btn of voteBtns) {
        if (btn.closest('challenges-item-mobile')) {
            $(btn).click();
            await new Promise(resolve => setTimeout(resolve, 4000));
            $(LetsGo).click();
            const picForVote = $(".modal-vote__photo__voted").prev();

            if (picForVote.length === 0) {
                $('div[ng-click="$ctrl.submit()"]').click();
                await new Promise(resolve => setTimeout(resolve, 4000));
                $('div[ng-click="$ctrl.close()"]').click();
                await new Promise(resolve => setTimeout(resolve, 4000));
                continue;

            } else {
                await picForVote.each(function (i, el) {
                    r = Math.random();
                    if (i >= 20 && r > 0.2) {
                        $(el).click();
                    }
                });
                await new Promise(resolve => setTimeout(resolve, 4000));
                $('div[ng-click="$ctrl.submit()"]').click();
                await new Promise(resolve => setTimeout(resolve, 4000));
                $('div[ng-click="$ctrl.close()"]').click();
                await new Promise(resolve => setTimeout(resolve, 4000));
            }
        }

      //  if (boostBtns.length >= 1) {
        //    for (var btn of boostBtns) {
           //     $(btn).click();
          //    await new Promise(resolve => setTimeout(resolve, 4000));
           //    const picForVote = document.querySelector('div.c-modal-boost__photos > div:nth-child(1)');
          //     $(picForVote).click();
          //    await new Promise(resolve => setTimeout(resolve, 4000));

         //  }

      //  }
    }
});
await console.log('Voting Done');
await browser.close();

}

main();

Ah no sorry, the //const iPhone = devices['iPhone X']; is to emulate browsing from a phone, I did this change after it was fixed previously, felt it would be less resource intensive

I think if (btn.closest('challenges-item-mobile')) {

would need to be
if (btn.closest('my-challenges__items')) {

if removing mobile emulation

mshonak commented 3 years ago

hi maatt with this line : " if (btn.closest('my-challenges__items')) { " instead of "if (btn.closest('challenges-item-mobile')) {" it is not working - it say " Voting Done" and closed .

noverotajs commented 3 years ago

Hi

It seems it does not vote in single photo challange

mshonak commented 3 years ago

noverotajs you're right - I checked it and it skips single photo challenges.

maatt commented 3 years ago

OP doesn't seem active on this project so it's hard to get updates here;

I have started a new repository and shared my personal edit of the script, it runs headless, with console output of each stage, runs every 30 minutes.. also uses nodemon so if the script crashes it will restart.

alt text https://github.com/maatt/gurushots-auto-vote-and-boost

mshonak commented 3 years ago

Thanks maatt ,I will give it a try :-)

noverotajs commented 3 years ago

OP doesn't seem active on this project so it's hard to get updates here;

I have started a new repository and shared my personal edit of the script, it runs headless, with console output of each stage, runs every 30 minutes.. also uses nodemon so if the script crashes it will restart.

alt text https://github.com/maatt/gurushots-auto-vote-and-boost

not found anymore

mshonak commented 3 years ago

Maatt your script is not working any more
got massage " Challenges Available to Vote on : 0"
and then "Voting Done" Also the new repository you open is not found any more can you help Thanks

noverotajs commented 3 years ago

this is the last and the best version I am using withour any isues. Works through terminalserver. Works everywhere. Only works slow. About 20min if almoust all contests open https://www.alksnis.eu/downloads/gurushits/GuruShitsAutoLike.js

sbursik commented 3 years ago

Same here. Starting Gurushots Auto Voter


@.*** is already logged in, redirecting...

Beginning the Vote Session:

Challenges Available to Vote on: 0

On Fri, May 21, 2021 at 8:21 AM JanisA @.***> wrote:

this is the last and the best version I am using withour any isues. Works through terminalserver. Works everywhere. Only works slow. About 20min if almoust all contests open https://www.alksnis.eu/downloads/gurushits/GuruShitsAutoLike.js

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/newstlastlist/GuruShots-auto-Voter/issues/16#issuecomment-845945715, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACKV2T3YG6TEC6L2DLXQWDDTOZM5BANCNFSM4ZCSPJ6A .

--