NeweggBot icon indicating copy to clipboard operation
NeweggBot copied to clipboard

A few notes - maybe not issues

Open cmilkosky opened this issue 5 years ago • 1 comments

Thanks for posting this btw, it stinks that I have to compete with scalpers in this way just to get one card for myself at the right cost.

A few notes:

  • the default setting in the config file was to refresh/add something to the cart every 5 seconds will block you in a couple of hours. I had 4 items, so I may have experienced that sooner than most

  • I tried this on Linux first and ran into trouble getting puppeteer to run. Installed Mozilla, set the PUPPETEER_EXECUTABLE directory to where firefox was, but then had memory issues because I was running this on a Raspberry Pi 3! After that, I installed Node.js 14.x on my Windows 10 PC, and was able to get it running

  • I found that I needed to create a .npmrc with the PUPPETEER_PRODUCT setting to be recognized. Probably me just being a noob with node on Windows

Chris

cmilkosky avatar Dec 08 '20 18:12 cmilkosky

The author can generate a random number between 5-12 seconds for the refresh rate. This way it possibly will avoid IP ban. Here is the snippet:

function getRandomArbitrary(min, max) {
    return Math.random() * (max - min) + min;
}

function getRandomInt(min, max) {
    min = 5;
    max = 12;
    return Math.floor(Math.random() * (max - min + 1)) + min;
}

CodeZ1LLa avatar Dec 08 '20 20:12 CodeZ1LLa