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

Add capabilities/refactor #52

Open
spearmootz opened this issue Mar 3, 2022 · 3 comments
Open

Add capabilities/refactor #52

spearmootz opened this issue Mar 3, 2022 · 3 comments
Labels
question Further information is requested

Comments

@spearmootz
Copy link

I was reviewing the code and while it looks fairly good i think this can be improved by using webpack and separating things into their own files.

I took this program and modified it to buy open box items and i am testing it now. i would like to contribute it back but it was kind of a hack. so not sure if it would be accepted buy i might take a stab at refactoring to a more OOP style, where the state is determined in some central index file but then the logic in other files actually do the work. i also found room to improve upon the setTimeout situation by using promises and having smaller timeouts. so for example

const clickButton = (selector) => new Promise(resolve => {
  setTimeout(() => {
    const button = document.querySelector(selector);
    if (button) {
      button.click();
    } else {
      resolve(clickButton(selector));
    }
  }, 100)
});

await clickButton("someSelector");

// move on to subsequent click
@spearmootz
Copy link
Author

please let me know if this would be accepted so i can start, obviously this would need to be compiled, so a couple of more steps for noobs but more extensible, maintainable

@spearmootz
Copy link
Author

i also added in my version the ability to add a list of skus to look for in a search page. which is not as useful due to timing in drops but probably fine in open box

@kkapuria3 kkapuria3 added the question Further information is requested label Mar 3, 2022
@kkapuria3
Copy link
Owner

code needs refactor. do you have a working version open source ?

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

No branches or pull requests

2 participants