Skip to content

Instantly share code, notes, and snippets.

@dustinbrownman
Created December 15, 2020 20:49
Show Gist options
  • Select an option

  • Save dustinbrownman/ced9a4fcc732dde74d46b572ee753170 to your computer and use it in GitHub Desktop.

Select an option

Save dustinbrownman/ced9a4fcc732dde74d46b572ee753170 to your computer and use it in GitHub Desktop.
Add PS5 to cart
// PS5
var interval = setInterval(() => {
fetch("https://www.walmart.com/api/v3/cart/customer/:CID/items", {
"headers": {
"accept": "application/json",
"accept-language": "en-US,en;q=0.9,es;q=0.8",
"content-type": "application/json",
"sec-fetch-dest": "empty",
"sec-fetch-mode": "cors",
"sec-fetch-site": "same-origin"
},
"referrer": "https://www.walmart.com/ip/Sony-PlayStation-5/363472942?irgwc=1&sourceid=imp_xNX0HETbxxyOW8bwUx0Mo3cmUkiXtPRhT3cmw40&veh=aff&wmlspartner=imp_312361&clickid=xNX0HETbxxyOW8bwUx0Mo3cmUkiXtPRhT3cmw40&sharedid=",
"referrerPolicy": "strict-origin-when-cross-origin",
"body": "{\"offerId\":\"E4463E9F89294147BB57304778A66539\",\"quantity\":1,\"location\":{\"postalCode\":\"YOUR_ZIP_CODE_HERE\",\"city\":\"Portland\",\"state\":\"OR\",\"isZipLocated\":true},\"shipMethodDefaultRule\":\"SHIP_RULE_1\",\"storeIds\":[]}",
"method": "POST",
"mode": "cors",
"credentials": "include"
}).then(resp => {
console.log(resp);
if (resp.status !== 400) {
alert("success");
}
})
},
1000)
@dustinbrownman
Copy link
Author

Important make sure to replace the placeholder with your zipcode. It probably doesn't matter since these were online sales, but I'm pretty sure that YOUR_ZIP_CODE_HERE will throw an error

@dustinbrownman
Copy link
Author

Oh, and to stop the pinging, close the tab or use this:

clearInterval(interval);

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