pollmommy
pollmommy copied to clipboard
Can we get a start.js or other callable script?
I'm currently trying to build the pollmommy functionality into an AppleScript for a simple macOS application for a group of people, though there is no 'start.js' or similar to call from the script. Is there any chance that could be added?
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();