Skip to content

Instantly share code, notes, and snippets.

@moeiscool
Last active May 1, 2024 12:31
Show Gist options
  • Select an option

  • Save moeiscool/b6cd0bfd9ad55556aa4e8a8f4640e30c to your computer and use it in GitHub Desktop.

Select an option

Save moeiscool/b6cd0bfd9ad55556aa4e8a8f4640e30c to your computer and use it in GitHub Desktop.
Browser-Based Buy Bot for BestBuy Xbox Series X or PS5

Browser-Based Buy Bot for BestBuy Xbox Series X or PS5 (Tested on BestBuy.ca)

This is not made for scalping. It is made for people who just want a dang console.

I made this to run in my Google Chrome web browser. You will need to leave a tab open. When the console is seen as available it will be added to your cart, default confirmations will be selected then you will be brought to the payment information page. Once it makes it to the payment information page a sound will play and an alert popup will appear.

If it is out of stock it will just wait 2 minutes and refresh.

This script will not complete any checkout processes. It will not process any purchases against your payment information. It only gets you to the payment information input page.

You should already be logged in and you should add your payment details in the Account page before hand.

#How to use :

  1. Open Google Chrome
  2. Install a Browser Extension that allows you to run custom javascript on the website.
  1. Open a Tab at https://bestbuy.ca
  2. Once installed click the CJS icon in the top right of the browser window.
  3. Paste the code from the buyFromBestBuy.js file and press Save.
  4. Refresh and it will become active. You can see the log posts in the Developer Console of your web browser.

This can technically work in any browser. You just need a module to run the custom code each time page refreshes.

var audio;
function doSound() {
try{
audio.pause();
}catch(err){
}
audio = new Audio('https://www.soundhelix.com/examples/mp3/SoundHelix-Song-7.mp3');
audio.play();
}
var bestBuyTimer = parseInt(localStorage.getItem('best-buy-count'))
var secondsToRefresh = 1
bestBuyTimer = isNaN(bestBuyTimer) ? 1 : bestBuyTimer
setTimeout(() => {
var bestBuyXboxPath = '/en-ca/product/xbox-series-x-1tb-console-new-model-online-only/14964951'
var bestBuyPS5Path = '/en-ca/product/playstation-5-console-online-only/14962185'
var confirmNoWarranty = '/en-ca/required-parts'
var paymentChoice = '/en-ca/basket'
console.log('Checking Xbox Page...')
if(
location.pathname.indexOf(bestBuyXboxPath) > -1 ||
location.pathname.indexOf(bestBuyPS5Path) > -1
){
const el = document.querySelector('.addToCartButton');
console.log('Is Xbox Series X page')
if(el.disabled){
++bestBuyTimer
secondsToRefresh = (70 + bestBuyTimer)
console.log(`Out of Stock... Reloading in ${secondsToRefresh} seconds`)
localStorage.setItem('best-buy-count',`${bestBuyTimer}`)
setTimeout(() => {
location.reload();
if(bestBuyTimer > 9){
localStorage.setItem('best-buy-count',`1`)
}
},1000 * secondsToRefresh)
}else{
doSound()
el.click()
}
}else if(location.pathname.indexOf(confirmNoWarranty) > -1){
doSound()
const el = document.querySelector('[data-automation="go-to-cart"]');
console.log('Is Confirm Adding Page')
if(el.disabled){
console.log('Error on Page')
setTimeout(() => {
location.reload();
},1000 * 20)
}else{
console.log('Going to Cart!')
el.click()
}
}else if(location.pathname.indexOf(paymentChoice) > -1){
alert('BUY THE XBOX MAN!')
doSound()
}else{
console.log('Wrong Page : ' + location.href)
}
},5000)
@ovochase
Copy link

@Helpmebuyaconsole did you get a series x yet? I have one I’ll sell you for $550. That’s what you’d pay after tax

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment