List Eight Sleep accessories catalogue
Automatically list Eight Sleep accessories catalogue on eightsleep.com. List the products on the Eight Sleep US accessories page, with each product's id, link, name, description, badge, default price and price before discount in US dollars, and its number of offers. Eight Sleep has no search box, so this script gives the full catalogue page. The Pod itself has its own page: pass pod-cover to eightsleep.com/get_product. Use a product id or link with eightsleep.com/get_product to get its sizes and offer ids.
Inputs
None
Output
url requiredproducts requiredcurrency optionalCurrency of the prices, e.g. usd.
FAQ
Remove a line from the Eight Sleep cart
Remove one line, with all its quantity, from the Eight Sleep US guest cart of this browser, and return the cart after the change. Get line ids from eightsleep.com/list_cart_items. When the cart has no such line, the cart does not change and removed is false.
Add an Eight Sleep offer to the cart
Add one Eight Sleep US offer (a size, zone or pack option of a product) to the guest cart of this browser, in the quantity given, and return the cart after the add with the product id, offer id and name of the line added. Get offer ids from eightsleep.com/get_product. An offer id that the store does not sell, or a quantity below 1, is refused before the cart changes. The script does not add the items the site asks for with some products, for example the Autopilot plan with a Pod, and it does not go to checkout.
List Eight Sleep cart items
List the lines of the Eight Sleep US guest cart in this browser: each line's id, product id, offer id, name, seller, quantity, unit price and line price, plus the item count and the cart total before tax, in US dollars. A browser with no cart gives an empty list and a total of 0. Pass a line id to eightsleep.com/remove_from_cart.
