Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do i run more than once #210

Open
Andrewjhobbs opened this issue Sep 23, 2018 · 3 comments
Open

How do i run more than once #210

Andrewjhobbs opened this issue Sep 23, 2018 · 3 comments

Comments

@Andrewjhobbs
Copy link

Hi, im trying to use this, im new to codeing, how do make it so it run more than just 1 time thanks!

@dominikwilkowski
Copy link

Here is what I wrote:

const Pollmommy = require('pollmommy')
const pollmommy = new Pollmommy()

function autoVote( count = 1 ) {
	const poll = 111;
	const answer = 222;
	const url = 'https://www.your-domain.com';

	process.stdout.write(`Contacting ${ String( count ).padStart( 4, '0' ) } - `)
	pollmommy.vote( url, poll, answer )
		.then( () => {
			console.log('\u001B[32mvoted!\u001b[39m');

			autoVote( count + 1 );
		})
		.catch( error => {
			console.error(`\u001B[31m${ error.message }\u001b[39m`);

			setTimeout( () => autoVote( count ), 1000 );
		})
}

autoVote();

@austinderocher
Copy link

I need help. I followed the steps to install it and when I run it, it says the vote is successful, but my vote count does not change. The poll ends tomorrow so any help would be appreciated. (I am running it in command prompt)

@endri99
Copy link

endri99 commented Dec 15, 2020

Here is what I wrote:

const Pollmommy = require('pollmommy')
const pollmommy = new Pollmommy()

function autoVote( count = 1 ) {
	const poll = 111;
	const answer = 222;
	const url = 'https://www.your-domain.com';

	process.stdout.write(`Contacting ${ String( count ).padStart( 4, '0' ) } - `)
	pollmommy.vote( url, poll, answer )
		.then( () => {
			console.log('\u001B[32mvoted!\u001b[39m');

			autoVote( count + 1 );
		})
		.catch( error => {
			console.error(`\u001B[31m${ error.message }\u001b[39m`);

			setTimeout( () => autoVote( count ), 1000 );
		})
}

autoVote();

where do i put this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants