Giter VIP home page Giter VIP logo

kkapuria3 / bestbuy-gpu-bot Goto Github PK

View Code? Open in Web Editor NEW
617.0 19.0 68.0 3.91 MB

BestBuy Bot is an Add to cart and Auto Checkout Bot. This auto buying bot can search the item repeatedly on the ITEM page using one keyword. Once the desired item is available it can add to cart and checkout very fast. This auto purchasing BestBuy Bot can work on Firefox Browser so it can run in all Operating Systems. It can run for multiple items simultaneously.

License: MIT License

JavaScript 77.00% HTML 23.00%
bot addtocart bestbuy-monitor bestbuy-item-tracker gpu gpubot rtx3060 rtx3070 rtx3080 rtx3090

bestbuy-gpu-bot's Introduction

Discord


  • Works with all/any of the Browsers
I took bits from best open and closed sourced bots and made this simple bot.
Please star my repo if this contribution helped you ! Its FREEE !

** CREDIT CARD INFORMATION IS NOT USED. BOT WILL ALSO RUN WITHOUT CVV INFORMATION; just not do FINAL CHECKOUT


Please Join Support & FAQ Discord if you have questions.

BestBuy Bot — Open Source GPU/PS5/Xbox Bot

Description

BestBuy Bot is an Add to cart and Auto Checkout Bot. This auto buying bot can search an item repeatedly on the item page using one keyword. Once the desired item is available it can add to cart and checkout very fast. This auto purchasing BestBuy Bot can work on Firefox Browser so it can run in all Operating Systems. It can run for multiple items simultaneously.

"Running a bot can increase your success chances only ; but does not guarantee that you will successfully cart each time. If you do not agree, then please do not use this code."

Why???

I built this in response to the severe tech scalping situation that's happening right now. Almost every tech product that's coming out right now is being instantly brought out by scalping groups and then resold at at insane prices. $699 GPUs are being listed for $1700 on eBay, and these scalpers are buying 40 carts while normal consumers can't get a single one. Preorders for the PS5 are being resold for nearly $1000. My take on this is that if I release a bot that anyone can use, for free, then the number of items that scalpers can buy goes down and normal consumers can buy items for MSRP. If everyone is botting, then no one is botting.

Getting Started

  1. Create a github account. It always helps !
  2. Star this repository. Its FREE !
  3. Please follow me here if you like my contribution:

Dependencies

  1. Install Tampermonkey Extention
  2. BestBuy Account (Please be signed in)
  3. Please allow Pop-Ups for https://www.bestbuy.com/ in your browser

Installing

  • Go to tampermonkey dashboard from broswer extension and create a new script
  • Delete all the contents and copy full code from best-buy-tm.js
  • Save the script
  • Updated REQUIRED FLAGS to your specifications

Testing/Strategies

Since BestBuy has queue system for when GPU/Consoles drop, testing bot is impossible outside the actual drop. Its recommended to run the bot during/before the drop as drops occurs in waves over few mins to hours. Join our discord for historical drop data, FAQs and strategies. Discord

Further Details

  • Item Keyword corresponds to a keyword in your product name ( case sensitive | no spaces allowed ) you can retrive ITEM_KEYWORD from the Black Title on a specific Products Page
const ITEM_KEYWORD= "3060";
  • Credit Card CVV (Not Required. BOT just wont do final checkout)
const CREDITCARD_CVV = "***";
  • Test Mode "YES" will not purchase item. But do all the steps except pressing the last button. TESTMODE = "No" will purchase the item.
const TESTMODE = "Yes"
  • Enter last 4 digits of phone # for SMS verification (optional)
const SMS_DIGITS = "****"

Workflow

This tool is designed to multitask. That means, it can run in many tabs simultaneously, if there is a ITEM_KEYWORD overlap. If there is no ITEM_KEYWORD overlap. You will need to create a new copy of script for each ITEM_KEYWORD.

Please make sure your CART is empty.

After updating variables and enabling the script in Tampermonkey, go to the your favourite GPU page in BestBuy. If the Title of GPU has ITEM_KEYWORD, it will add the item to cart and checkout. If item is out of stock it will keep on refreshing every 5 seconds.

Please use TESTMODE = "Yes" to test with an item already in stock.

Authors

  • Karan Kapuria

Buy Me A Coffee

Version History and Changelog

  • 1.0 Initial Release
  • 1.1 Handle Please Wait Gracefully
    • If Please Wait button shows up, bot will check every for second ATC button every 20 seconds
    • Whenever second ATC button appears, it will click and checkout
    • Reading Logs in Console
  • 2.0 - 'Please Wait...' items can now be CARTED and CHECKEDOUT
    • If "Please Wait" button shows up, it will enter a loop of retries which will check the color of button.
    • As long as button stays Gray, it will try and check for Yellow Color
    • Whenever Yellow ATC button appears again, it will click and checkout
    • Status Bar is now being added at bottom
    • Status Bar now shows version and TESTMODE variable
  • 2.5 - 'Fixed Memory Leak' no more refresh ! We will recycle tabs.
    • Due to constant reloading of OOS items, memory on your browser slowly blows up
    • We will now kill the tab if item is OOS and open it in new page. Doing this infact reduces the total RAM usage.
    • Button clicks no more use .click() but instead use EventListeners()
    • Status Bar is now 50% of screen. Little taller so last line is visible when page is loading.
    • Status Bar now shows ITEM_KEYWORD
    • We will now play a music when item is carted.
    • Since BB asks for verifying account sometimes. Alert will help so that you dont miss checkout.
    • MAX_RETRIES will now control when your page gets reloaded when you are stuck on please wait screen. In this case it will perform normal reload.
  • 3.0 - Conjuction with 'Nerd Speak' Extension
    • MAJOR CHANGE: BOT ONLY WORKS FOR CHROME NOW (Version 2.5 and older are all browser compatible)
    • Bot will now extract queue time from NS extension
    • QUEUE_TIME_CUTOFF will keep requesting better queue times until target value is reached
    • NEW_QUEUE_TIME_DELAY is delay in seconds between requesting new queue times.
    • Status Bar is 75px fixed
    • Status Bar now shows more information
    • Since BB asks for verifying account sometimes. Alert will help so that you dont miss checkout.
    • MAX_RETRIES will be deprecated in future.
  • 3.1 Best Buy disabled 5800-5600x tests
    • Best Buy has disabled 'Please Wait' testing for 5600-5800 , they also updated their button classes.
    • I have Added extra layer of code which will handle for new button classes.
    • Please Wait functionality should still work if layer we added is not activated.
  • 3.2 Extra Button Class Layers Added
    • Button classes layered into 'if else' loops
    • When 1st ATC is pressed. 'Adding..' takes about 4-6 seconds. We double check gray color for 'Please Wait'.
    • If not Please Wait then 2nd ATC is triggered
  • 3.3 Button layers are reinforced
    • Easy edit button classes and better console logs.
  • 3.4 GotoCart Button Class Layers and some bug fixes
    • Added check for CVV element to avoid error when element is not present
  • 3.5 Handler for entering last 4 digits for SMS verification
  • 3.6 Added several Button Class Layers and updated to click new Verify Your Account button
    • Updated NEW_QUEUE_TIME_DELAY flag to change how often new queue time is requested
  • 3.7 Removed Nerdspeak Integration
    • Commented out Nerdspeak Integration due to possible account flagging by Best Buy causing queue looping
  • 4.0 BB Queue Timer and Sign-In on Container tabs
    • Added QueueTimer Functions - Queue Timer is now shown on bot UI during please wait
    • Increase Verfication Time from 1.5 - 2.5s
    • Automatic 5 seconds signin after cart when running on private container tabs
    • QueueTimer Functions gets called when really please wait is detected
    • Updated Bot Messages

License

This project is licensed under the MIT License - see the LICENSE.md file for details

bestbuy-gpu-bot's People

Contributors

kkapuria3 avatar rnario85 avatar talitore avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bestbuy-gpu-bot's Issues

Verifying and submitting issues Maybe cvv issues?

The bot runs, goes through the checkout, gets to the last step. but it does not click the final "place your order"

I don't know exactly where the code is having issues, Testmode was turned off, I'd checked it multiple times
Its gets to the final Checkpoint then says Verifying and submitting.

Something I noticed, the CVV code only popped up for the first test. (on the first test, when I didn't work I clicked the place order button manually and it checked out. canceled the order afterwards on my test object)

After that, the cvv box quit popping up.

I read the previous article on the cvv bug, it was closed, and the newest update should have fixed it. Meaning it might not be the cvv box causing issues.

I even re-copied the code, and started fresh, making sure to only change the main flags. I do have my cvv added, and my sms added for verification.

also a question, as I hadn't found an answer elsewhere, is there was way to have the bot switch to shipping instead of in store pickup?

image

Any way to get a specific 3090?

I am looking to get a 3090 founders edition but I don’t see any way to do this because the item keyword can’t have spaces.

Improvement suggestion

Works well for me on testing!
I have one input if sounds good to you, after 2nd time ATC is clicked, it can try directly one of 2 URLS:
bestbuy.com/checkout/r/fast-track
bestbuy.com/checkout/r/fulfillment

Bot will not proceed after fulfillment screen

I don't know if this is a new feature on Best Buy's cart page, but there is a fulfillment page that has a "Proceed to Payment Information" button after the page which checks for the keyword and clicks "Checkout". The bot stops the process here and will not continue to the page with the CVV verification, regardless of testmode Yes or No. Note, I'm trying to preorder an item at drop rather than purchase a graphics card at drop but the keyword check works fine, and I'm testing the bot by preordering something else that is currently in stock with the same keyword in the title.

Option to use saved items list

I've heard people may have better luck by adding to the cart from the saved items list.

This seemed like it should be a fairly easy implementation but the page is slow to load so the script runs before the button loads and can't find it.

if (pagetitle.includes(ITEM_KEYWORD) || pagetitle.includes("Saved")) {

         //Create Custom Badge
         //
         const $badge = createFloatingBadge("Auto Detecting Mode", "Initializing ..");
         console.log('BEGIN ')
         document.body.appendChild($badge);
         $badge.style.transform = "translate(0, 0)"
         //Out of Stock Button
         //
         var OOSButton;
         const OOSButton_SavedItems_L1 = "c-button c-button-outline c-button-sm c-button-block add-to-cart-button"
         //c-button c-button-outline c-button-sm c-button-block c-button-icon c-button-icon-leading add-to-cart-button
         const OOSButton_L1 = "c-button c-button-disabled c-button-lg c-button-block add-to-cart-button"
         const OOSButton_L2 = "btn btn-disabled btn-lg btn-block add-to-cart-button"
         console.log('BEGIN ')
         if (document.getElementsByClassName(OOSButton_L1).length == 1)
         {
             OOSButton = document.getElementsByClassName(OOSButton_L1);
             console.log('OOS Button Class 1 : ' + OOSButton_L1)
         }
         else if (document.getElementsByClassName(OOSButton_L2).length == 1)
         {
             OOSButton = document.getElementsByClassName(OOSButton_L2);
             console.log('OOS Button Class 2 : ' + OOSButton_L2)
         }
         else if (document.getElementsByClassName(OOSButton_SavedItems_L1).length == 1)
         {
             OOSButton = document.getElementsByClassName(OOSButton_SavedItems_L1);
             console.log('OOS Button Saved Items Class 1 : ' + OOSButton_SavedItems_L1)
         }

I tired adding event handlers to wait for the page to load but I could never get the window.onLoad event to fire for the popup, even if I attached an event handler to it.

Adding support for gift card purchases.

I think it would be a particularly fruitful addition to add support for the auto entering of gift cards supplied to the program in the event that checkout is reached.

Stuck in Auto Detecting Mode

Hello, so I have been testing the bot using the AMD 5800x graphics card. I get this message:

"Open Source BB-Bot V3.2 ◻️ TESTMODE: Yes ◻️ ITEM KEYWORD: 5800
Auto Detecting Mode
Initializing .."

However, it never adds it to my cart and I am not sure why not. Please let me know. Thanks!

Bestbuy.com window closes on OOS refresh

I have just set up the bot following your detailed instructions, however when I set my preferences and go to the card I wish to purchase that is currently OOS the web page closes after the time set by " const OOS_REFRESH = 30 // (in Seconds) Refresh rate on OOS item." Using latest version of chrome, windows 7 latest SP

I tested using an in stock item and the bot functions properly up to check out.

No discord link

would love to join the discord, but no link to follow on the github. There is a picture that says join the discord but it is not a link, only a link to a picture.

"Verify Your Accout" Blue Button

Hello, I have a questoin regarding the handling of the "Verify Your Account" button

  1. Isn't rgb(0, 70, 190) the blue color of the "Verify Your Account" button, but the comments say the button changes to yellow so lets click it again?
if (MainButtonColor === 'rgb(255, 224, 0)' || MainButtonColor === 'rgb(0, 70, 190)') {
    // Color of Button Changes to yellow then click again
    let ATC_Color = window.getComputedStyle(InStockButton[0]).backgroundColor;
    // When button turns yellow, we scream bagged !
     console.log("Add to Cart is available:" + ATC_Color + " | Lets Bag This ! ");
  1. Whats the difference between ATCYellowButton_L1 and ATCYellowButton_L2?
 const ATCYellowButton_L1 = "btn btn-primary btn-lg btn-block btn-leading-ficon add-to-cart-button"
 const ATCYellowButton_L2 = "c-button c-button-primary c-button-lg c-button-block c-button-icon c-button-icon-leading add-to-cart-button"
  1. Similarly, whats the difference between GotoCartButton_L1 and GotoCartButton_L2?
const GotoCartButton_L1 = "c-button c-button-secondary btn btn-secondary btn-sm c-button-sm btn-block c-button-block"
const GotoCartButton_L2 = "c-button c-button-secondary c-button-sm c-button-block "

Window constantly switches

I don't know much about tampermonkey; But the whole reload and close old tab functionality means I can't really use my chrome.
Any fixes?

Not adding to cart

Seems BestBuy updated buttons again. Can you take a peek at this please?

Bot Crashing

Bot appears to be crashing on initializing when keyword is set to 1G142 (NVIDIA GeForce RTX 3060 Ti)

Improvments

Here's a good blueprint on how to go further:

Look into using a mitm proxy to capture the requests, and mimicking the requests.

Look into creating an engine for creating tasks, so that you can run multiple at once.

Look into creating different modes, such as all requests or all browser

Not Adding to Cart

I'm testing this bot on a remote Ubuntu VM through RDP. Everything was installed today and should be the latest version. When I go to a page to test the bot, no item is being added to my cart.

I can tell that the script is active. The output in the bottom left corner is:

Open Source BB-Bot V3.1 ◻️ TESTMODE: Yes ◻️ ITEM KEYWORD: X570-PLUS
Auto Detecting Mode
Initializing ..

Is this broken because of a recent update or am I doing something wrong?

Tab Keeps Closing

Tab keeps closing when it detects its out and tries to auto refresh. I filled out the red flags and put yes for test because I want to manually buy, I open the FE page on BB and then this issue occurs. Please help.

Ended on review page without checking out

I am running with Testmode = No, Cvv and sms filled in. When the item restocked, the page ended up on the leave a review page but the item was not purchased. The item was also not in cart.

Window closes after first refresh when looking for out of stock items.

Every time I try to leave the bot running for an out of stock item it closes the tab. I let it sit for a minute or two after closing and nothing happens. I also tried running it in a separate window and the same thing happens. Did I do something wrong when setting up the bot that could have caused this?

Window.Open not triggering

I was not able to determine why, but window.open is not working for me. It never opens a new window/tab and then when window.close fires, the process ends.

I resolved this locally by adding the following instead of window.open

// @grant GM_openInTab

GM_openInTab (window.location.href);

This seems to also protect against the mentioned memory leak.

Delivery Option Click

I'm not sure if other people are facing this but in NYC best buy has default pick at store option.

When running this bot, it take this item to cart and continue to verification step. But after this you cannot click a delivery option. I was unable to checkout and pick a store to pick up my GPU. Best has a timer letting me know that my card was "RESERVED" (yeah right lol) but no stores in 200 miles had one for pick up.

I've added a handler to click the delivery option if it exists.

I can make a push to your repo and make pr if you grant me access.

@kkapuria3

Add capabilities/refactor

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

Test check out defaulted to "Store Pick up"

Any way to change the delivery method to "Shipping" during check out? If left untouched, the bot might just check out using the "Store Pick Up" option as the default which is undesirable. Thanks!

CVV Bug

I think this section needs to be corrected. It errors out if the CVV field is not present. Also the first .value line is redundant.
Current:
// CVV Number of Saved Card
// Bug fix: by craz3drunner (discord member)
document.getElementById("cvv").value = CREDITCARD_CVV;
document.getElementById("cvv").focus();
document.getElementById("cvv").select();
if (!document.execCommand('insertText',false, CREDITCARD_CVV)) {
document.getElementById("cvv").value = CREDITCARD_CVV;
}

New:
if(document.getElementById("cvv") != null) {
document.getElementById("cvv").focus();
document.getElementById("cvv").select();
if (!document.execCommand('insertText',false, CREDITCARD_CVV)) {
document.getElementById("cvv").value = CREDITCARD_CVV;
}
}

where i can find another button?

I try rewrite that bot for another store. I compare buttons on bestbuy and in source code for change them for another store.

  1. Where i can find that buttons?
    const OOSButton_L2 = "btn btn-disabled btn-lg btn-block add-to-cart-button"
    i find only that button
    const OOSButton_L1 = "c-button c-button-disabled c-button-lg c-button-block add-to-cart-button"
    image

Open Source Programs Used ?

I am sure this works but this looks a little bit sketchy. If I could get some links to the open-source programs you used that would be awesome! Thanks! Also If they are somewhere in the description sorry bout this lol.

Program Stuck in Initializing?

I'm new to get hub and this sort of thing, but recently my bot has been stuck in Initializing. I've tried closing and reopening the window, signing in and out of my BB account, and re starting the script from the ground up but nothing seems to work... It was working fine the first couple of days as well, but then just suddenly stopped.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.