Amazon Watch - Auto-Order as soon as an article is available

Once in a while, you may want to preorder something on Amazon, you set an Email notification to inform you when it is available again...You get that Email (probably minutes or even hours later) and you open the article link, but it is out of stock again. Since there is no "auto-order on availability" on Amazon, i created Amazon Watch.

Source: https://github.com/ateufel/AmazonWatch

How it works

  • Open the Amazon website (you may want to change that to Amazon.com instead of Amazon.de in Line 22).
  • Go to login form.
  • Enter credentials and login.
  • Open the specified article URL.
  • Activate One Click Buy.
  • Check for the preorder button.
  • If it is there, order the item. If not, reload the page after 5 seconds and check again.

A brief look at some of the Source - it is really straightforward:

Screenshot 2018-05-11 at 13.03.04.png

Technology Stack

The tool is built with Node.js/JavaScript, the only dependency is Puppeteer - a tool to control the Chrome headeless browser in an easy way.

Usage

  • Clone or download the repository - on some server or Raspberry Pi
  • Install packages: yarn install or npm install
  • Set Environment Variables with your Amazon credentials: AW_EMAIL / AW_PASSWORD
  • Start the server with the Amazon Article URL: node index https://www.amazon....
  • Wait...

You can also use pm2 instead, of course: pm2 start index

If you set the headless option in the source to "false", you can watch how the script works. Perfect for testing :)

Future Plans

  • I may implement some notification when the article has been ordered. Not sure if that is really needed, after all you do get an Email from Amazon anyway. I am happy to get tipps to improve it though. Just create an Issue on Github, or comment on this thread if you want to contribute in any way.
  • Right now, you can only watch a single article. Of course you can start several instances with pm2, but putting all article URLs into a JSON file may be an improvement.

My Github Account: https://github.com/ateufel
Amazon Watch: https://github.com/ateufel/AmazonWatch

H2
H3
H4
3 columns
2 columns
1 column
Join the conversation now
Logo
Center