Building An Amazon Stock Monitor App | Ritesh Verma | Skillshare

Playback Speed

  • 0.5x
  • 1x (Normal)
  • 1.25x
  • 1.5x
  • 2x

Building An Amazon Stock Monitor App

teacher avatar Ritesh Verma, Bot Developer | YouTuber | Student

Watch this class and thousands more

Get unlimited access to every class
Taught by industry leaders & working professionals
Topics include illustration, design, photography, and more

Watch this class and thousands more

Get unlimited access to every class
Taught by industry leaders & working professionals
Topics include illustration, design, photography, and more

Lessons in This Class

10 Lessons (48m)
    • 1. Welcome Everyone

    • 2. Installation

    • 3. Sending First Amazon Request

    • 4. Monitor Function

    • 5. Mini Lesson - Prompt Library Basics

    • 6. Run Function

    • 7. Creating Multiple Monitors

    • 8. Discord Integration

    • 9. Packaging Your Application

    • 10. What's Next?

  • --
  • Beginner level
  • Intermediate level
  • Advanced level
  • All levels
  • Beg/Int level
  • Int/Adv level

Community Generated

The level is determined by a majority opinion of students who have reviewed this class. The teacher's recommendation is shown until at least 5 student responses are collected.





About This Class

Class Description

 Building an Amazon Stock Monitor App

In this class I will teach you how to create an Amazon stock monitor app that checks the inventory and availability of an Amazon product and notifies you via Discord when an item is in stock. This is very useful for multiple purposes as people need stock monitor applications so they can check out an item as soon as it is in stock.


The Goal and Material

 The first video introduces our goal in this course, while the second and third video deal with installing NPM, Got, and NodeJS as well as using these frameworks/libraries to send our first request to the Amazon server. Many programmers in the industry have experience with HTTP requests so learning about them right now gives you a head start!

Section One – Monitor and Run Functions

Following the introduction and overall setup of the project, the first section features the core of the application. The Monitor()  function is what we will use to actually check the availability of an item through a GET request and HTML parsing using a npm library. We will explore how to find the proper requests to target to include in our program and then we will go through getting details from the response from Amazon’s server.

Section Two – Multiple Monitors and Discord Integration

In the second section of this coding project, we will further develop our program so that it can monitor multiple products on Amazon, or for any site for that matter. We will also use a library to communicate with Discord and notify ourselves through discord notifications when an item is in stock. While this may seem like an advanced coding concept, trust me I will walk you through it! Using APIs, libraries, and frameworks is all coding is in 2021.


Final Section – Packaging and Next Steps

In the final section I go over packaging our application so that we can run the application on any computer. This way a user you sell the monitor to does not have to install VSCode or any other IDE to run the Amazon Stock Monitor application. Also, I will cover how to package it for multiple OS so that if you have a Mac and Windows, you can run the application on both. I end off with presenting possible next steps you can take to take this stock monitor to the next level!


Who am I?

 My name is Ritesh – a student at the University of Maryland and on the side, I create academic YouTube videos about the SAT, college advice, coding, and productivity. My favorite videos to create are my computer science videos because as a computer science major, I love coding cool, unique projects that can help other individuals accomplish their own goals. A developer for the people you can say! I feel that I’ve learned a lot in my years as a software engineer, so I’ve decided to create an extensive, in-depth series of Skillshare classes to share my knowledge of the best project I have ever dove into: creating a fast and competitive checkout bot.


Other Helpful Links:

Instagram -

Twitter -


Meet Your Teacher

Teacher Profile Image

Ritesh Verma

Bot Developer | YouTuber | Student


Hey there, my name is Ritesh Verma.

I am a college student + YouTuber + CEO of SmartMinds Tutoring who loves creating videos based on computer science, bettering yourself, and financial wealth.

Due to the recent craze in attaining limited items and my 2 year experience in coding checkout bots, I created extensive Skillshare classes to teach students worldwide how to develop bots that they can use to finally get products that sell out within seconds.

If you'd like to stay in touch with me, please be sure to my Skillshare profile, and if you like my content and have useful ideas for classes, then send me a message/email and I'll take it into consideration.


See full profile

Class Ratings

Expectations Met?
  • Exceeded!
  • Yes
  • Somewhat
  • Not really
Reviews Archive

In October 2018, we updated our review system to improve the way we collect feedback. Below are the reviews written before that update.

Why Join Skillshare?

Take award-winning Skillshare Original Classes

Each class has short lessons, hands-on projects

Your membership supports Skillshare teachers

Learn From Anywhere

Take classes on the go with the Skillshare app. Stream or download to watch on the plane, the subway, or wherever you learn best.


1. Welcome Everyone: Welcome everyone. In this course, we'll be creating a super-fast, highly reliable Amazon stock monitor that will notify you via Discord when a product on Amazon is in stock. This way when they're rare item that sounds out within seconds drops on Amazon, you'll be the first to know and you'll be the first to checkout by the end of this course, you a better your understanding and NodeJS, async operations, HTTP requests, and many more things. You'll also be able to apply learning and discourse and create a stock monitor for any website you want. Furthermore, the fastest requests bots out there have a stock modern bill in to be able to develop this monitor. You are already the first step in your journey into creating the world's fastest Checkout button. By the way, did I mentioned that people pay big money for the stock monitors upwards of four to five figures. So why don't you just create a quick stock monitor that's really reliable, really fast, and you sell it for five figures. Sounds good, right? All right, then Let's get coding. 2. Installation: So the first step of developing his monitor is to first install the necessary resources to Ashley Dre everything. So the first thing we're going to need to install is no JS. So I'm personally using a Mac. So for this hour, just go on the MacOS installer, click this link and you'll see the NodeJS package underneath. I'll click it. And note-taking through the steps on Donnelly NodeJS and you can see npm is included within the download. Now already have NodeJS, so there's really no point of me doing this X-ray here, but you would basically just wanted press Continue, continue. Agree. And all the way forward. And once that is done, you want to go to a vicious to your code, go to Azure Studio Code. You want to go to a folder that you marry desktop right here, I made an empty folder. I opened it in VS Code. Let me minimize that. And now what you're going to do is you can create a new file, okay, let's name this a AMZN for amazon dot js. Alright, now, quickly to check that you have everything installed properly, what you want to do is you want to run well, to check and to actually make everything work. Once you run NPM install. And you see you have package.json, package.json. You want to make sure these two files are within the file view. If they're not there, things will not work. I also want to npm init. Okay. And it just keeps it is pressed enter all the way through. Yes. And that's that. Okay. So now if you have run npm install ready and everything worked out, then that means you have successfully installed Node JS, which is what we want. Now what we're going to do is we're going to install a second library. And we are first library. And that is called God. So we're literally going to say npm install, got sounds a little crazy, but that's the library name. So we'll do constant, got, equals required, got. Now you gotta be wondering what is, what does God? So let's check out what exactly is got Library and PM. Okay? So got Library is a slope. This load is basically a library that's used to handle HTTP requests and responses. Maybe if you guys have experience, you've probably use AK Steel's or you use the Request Library. I'm axis is another very famous library used to handle requests and send requests and get requests and you process them and what they know JS. But personally we will be using got for this monitor simply because I'm more used to it and I just like it anymore. So it's very easy to use and we're using this for the entire project. So make sure you have everything installed. Let's quickly just run something simple to make sure we have got Library installed properly. See if this is not installed properly is probably going to crash and it will print out Hello world. Let's do node AMZN dot JS. There you go. Hello World. So adducting is installed and we can move on. 3. Sending First Amazon Request: Alright, so now that we have everything installed, let's actually find the request, the master requests that we will be using to actually creates the entire monitor. Okay. So in order to do that, well, we have to do is we have to go to Amazon. I've had this part link already said, I go to this link. You see when we look at this 2020 flagship HB 14 Chromebook laptop, you can see right now it says there's 14 left in stock without really worrying about that. Well, we need to see is what request should we ping? Should we send to Amazon server and return like the HTML of the page right? Now if you see my previous course, you've, you've seen that I've used puppeteer in the past. I would not be using public sphere for this project. This would be purely request based. So what I have to do is somehow get this HTML right here. Because usually an Amazon where a product is in stock, I will say in stock was out-of-stock. You'll say out-of-stock. And what's the limit as Doc like in this case, Let's say only XML of items left in stock. In this case x is 14, right? So what we're going to be looking at is whether this has ist doch out-of-stock or has limited quantity. If it says stop or limited quantity, that means in stock who is valid. So we really only care about if this is doc, no matter how near left or out of stock. So again, what requests will give us that information, right? What request or it will return the HTML that we need to parse. So the way we do that as you go to network on Google Chrome DevTools. So make sure you have Chrome, you'll have Chrome. Things are really not going to work. And now what you want to do is quickly just clear everything. Now you want to refresh this page and pay attention to their requests are sent through. Again, pretty that refresh. Now it goes to the top. Okay. Okay. She's lot somebody requests are coming through. Now. I'm trying to scroll up and just not working. Okay. So the request that's going to matter, right? That's going to return to a show on this page is a request sent to this right here, okay. The requests and to this URL, this endpoint is what's a gun to? Its response is what's going to have the HTML that we're going to parse to be parsing. So let's look at it. Is this, it knows that no, no. Okay, look right here, right here. So we maximize this. We see this is the URL that we're currently on. So this is the request URL. Good. So we're going to have to do, they're going to have to basically copy these request headers and use them and mimic the same exact request within the code. Now I'll show you guys how this looks like. So we're going to do this. Let's do this. So okay, of constant response equals await got, oh, it was like an async function real quick. So async function monitor. And that we're going to do is got, Let's copy this link. There's our product blink. We're going to do is they're going to pass in this product link. Okay, now, and then we'll console.log, response.status code. Now the status code is basically well lets you know whether the request was valid or not. Usually a 400 plus status code means you failed to 100 or 200. One means you're good. Okay, so that's all we're going to do. Now we've called monitor and this actually should not work. And there's a reason I don't want it to work in depth. We shouldn't work. Oh, and worked. So after further inspection, I realized that right now this request will work simply because Amazon isn't really heavy on highly, it's not a high security alert right now. But when the time matters, when like a high-stake item like PS5 is dropping or are the new RTX card with some Pokemon cards even nowadays are dropping. Amazon security will be high-end and a simple request like this just won't work. So I know you guys probably were like, oh, it's just this easy. It's not this easy. And I was surprised myself, but it's not like that. So we have to do is we actually have to pass in headers. Now we'll call the variable my headers. And let's say a bar, my headers equals. And then we're going to have some headers. All right, So what's happening right here is we're passing in the headers that we will be creating, enter the request. And now what are these headers? You see right here. Now he's request headers right here. This basically gives your request to the server more validity and makes your request seem more like an app from actual browser, actual person, not a program or a bot. So we're going to have to do is copy some of this information, not the cookies, obviously, because cookies that will be generated through the browser stuff. We're not going to be worrying about that, but we're going to just be copying these request headers. So let's do that now. All right, so I cut to the part of where I have 18 red. And then because it's gonna be really boring, going through all those headers and copying it down. But you see right here I've all the headers. You can pause the video right now just to copy this information down. See right here. For the, for the agent, I just got my browser's you agents. So all I do is quickly Google search. What is my user agent? And then I just copy this into the user agent right here. So moving on, I have the, my, I had my header is copied down all the appropriate headers I need. And then I'll pass it into here and now I'll make the request again. It's just still work in anything. It should work better now. Node and it was on there you go. Status 200. So do it again just to make sure nothing broke it. A 100. Now, I know you guys, like I said, are probably like, well, it worked before too. Why does it matter when product that's really in demand is dropping? Security is height in guys and trust me, you don't want to just be relying on a simple GET requests without even passing in headers. It's just not going to work, trust me. So that is why we create our own headers using basically exact same information from their requests sent me the browser. That way You look like a real browser. And that's all we got to do. 4. Monitor Function: What's going on, guys, welcome back. And now in this video we will be parsing the HTML return in the response of the request reset. So if we look back at right here, right, we have responds. He was awake, got particle and headers, my headers. Okay, So you passing the headers, and now we're going to do is we're going to make sure the response one is there. It's not null, right? And we want to check the status code. The status code tells us, like I said, if the request was sent successfully or not. And the status quo return is a 200 one. So we're going to check if it equals to one. If so, then we're going to move forward. Actually equals 200. Okay, so now at this point, we need to parse HTML. So how did we even get the HTML? First of all, well, the response object, it returns in its body, the HTML from the request that side. So we're going to do now is we're going to just log this. Let's open a terminal. Show you guys what I mean. Okay, things some time we'd look at that. You see all the HTML I just came up who is going to parse all of that, right? Like it looks we have personal looks like gibberish. Second of all, if you scroll all the way up, you'll see that it just a bunch of tags. Then parsing this would be insane if you don't have some extra help. So let's get that extra help. And how are we going to do that? Well, right here, we're going to install a package called a node HTML parser. So npm installed Node HTML parser. So now that we have it installed, we're going to do now is we're going to do constant. Html parser is equal to require. Oops. No HTML parser. There you go. Okay? So now if the response object is there and the status code is successful, we're going to do is we are going to set let root equal to HTML parser, parse response.body. Okay? So now what this is doing is it's basically making this library parse an entire response body. So now accessing the HTML elements will be such an easy thing. I'll show you right here. So we have HTML, this page, okay? And now going back to the HTML for this segment right here, what you're going to be needing to actually get to the stock of the product or texts availability. We see right here. Look at that. There's a div right here. Div id equals availability. So we're going to grab this div and use it to get the actual text that says End stock out of stock or only XML, London's dock. So hard to do that. So let's copy the ID real quick. Availability. Okay? So let Avila availability is equal root query selector, root dot query selector. Now we're going to pass in the data. Okay? So now what this is, is this availability div basically represents this HTML over here. All right, so everything aside of it and the div itself, a div elements of. So once we validate the div actually does exist, what we're going to do is we're going to get the HTML, the inner text of this element right here, okay, This bank class. And how are we going to do that? Well, let's do this first. Document.getelementbyid, avail t. Okay, so we got the HTML element, right? We're going to do is we're going to access its child nodes, right? Its children, or do that, we just call it child nodes. And we see its nodes, right? And we see right here, looking at one, you see the enter text property is of the second child at one. So I'm going to do right here. We're going to do let End stock, that stock text, equal availability div, child nodes. And the second one, and then get that inner text. There you go. That should be this dark text that we need. Now we're going to make it to lowercase. Okay? So we've got the stock text right? Now. Before we move on, let's just console.log the stock text. Let's see if everything is working. There you go. Oh, sorry. Stock went down only 1911 and stock now. Alright. So now at this point you're probably like, whoa, now we just have to check the stock tax you what it equals and then we're done. Well, decks possible, but we're also going to integrate this two disc or later on. So let's grab some other details real quick. Okay, so first things first, let's do let product name. Equal to right here we're gonna, we're gonna get the name of the product. Let's see. So let's do the part name equal product link dot substring, product link, index of and when the index of com slash. Okay? So the product names obviously right here, right? This part right here. So we're going to com slash. So that says the zeros are 1, 2, 3, 4. So, oops, plus 4. And we're going to, to index slash dp. Okay? So this is gonna do is I'm going to grab the name of the product which is in-between this com slash in slash dp. Okay, there we need that for later on when we create our web hook for Discord has good, just grab that information right now. But let's quickly just valid it's dark text and print a in-stock Rouse documented. So it's dot text equals, equals out of stock. Console.log out of stock. Else console.log in stock. Okay, so now's do this and you'll see, there you go. The item is in stock. So now that we have our outer stock in-stock printing properly, we're going to do is make sure our margin method runs constantly and it doesn't run just once because essentially we're always going to need are monitored and keep monitoring the URL. So we're going to do, you're going to do a weight are set timeout. Let's do eight seconds. Okay. Whoops. Problems. Are, there you go. And then we're going to call monitor again with the console.log. Okay? Oh, return false for this is doing is after a monitors right here checks to as in-stock, out-of-stock is going away for eight seconds, right? And that's your call itself again. So then it enters the language that we need. And yeah, that way this will forever run until we cancel it. So let's quickly make sure that works. Oh, but it's only mistake, I forgot to pass into R. Now let's run it. Okay. So you got in-stock asking monetary get after eight seconds. And of course you guys can make it two seconds, three seconds. If you get two thousand and three thousand. And there you go. It monitors again as a key monitoring until we cancel it. So let's cancel it. And that'll be it for this video. So I'll see you on the next video where we will be going over the promising library which we will use to get the user input to make sure our monitoring and read in whatever link the user wants to monitor. 5. Mini Lesson - Prompt Library Basics: Hi everyone. So in this video I'm going to give a quick mini lesson on the prompt library, which we'll be using for the next video. So it's very short. So basically what's going to happen to do is do npm install prompt sink. Okay? Now you can use in your actual code for the main project cost in prompt equals or acquire. Prompt sink. Pretty good. Let's copy this over to this. Okay? So basically this library allows you to take a user input. So if I said on var, var gender equals prompt. Now you pick what question you want to ask the user. Ru, a male or female. You can say M, male and an F. Okay? And then you can just console.log, whatever they say. Well, this is doing is it's asking you, are you male or female? Is that, you know, do F, male or female? Obviously the user could put something like orange, right? And you have to just check to make sure it equals M or F right here. So let's do f, gender equals M or gender equals F. Console.log, gender. Else console.log. Try again. Okay, so Let's run it. Let's do node prompt dot js, that's R-E-S. Are you male or female? Let's do male. Actually, let's just quickly if I'm OCD kicking in. Are you male or female? M for male, this gonna say m again. Now if I run it again, are you male or female? I say orange. Say try again. So that's what the library does. It basically allows you to ask for user input. Very useful. I imagine you'll be using a lot your workplace depending on where you work. So keep this in mind. Tries library offers salt my own time and see you guys in the next video. 6. Run Function: Welcome back everyone. So in this video we will be creating the run function. And the run function is basically going to be no, the master method that calls monitor takes in user input and basically made our program what it is. So let's call r1. And we're going to do that. We're going to first prompt the user to enter a product link, okay? To let product link equal prompt. Enter link to monitor. Okay? And I shouldn't make it so far. And then we're going to do, do console.log. Now monitoring for the product link. Okay, so now we got the product line from the user, and now we asked, we asked them to enter the link. We display what they entered. And now what we're going to do is assuming that the user input a valid product link. What we can do real quick is say, if product link dot index of HTTP just makes sure that we have http, a full URL, basically right, is greater than 0. Then console dot log here, move this over here. Console.log error, invalid, URL. All right, and now we're going to do, we're going call monitor and we're going to pass in the product, product link. So this means that we're going to have to change this and having sure it takes into argument. And then we call it again over here. Again, pass in public. Okay, so let's comment this out so there's no confusion. Let's copy this part. This is Goody, goody. We need alright, so we got to run function that we'll call run. And we're going to add more to this later on in the course as you guys to see very soon. But for now this should be plenty. Okay, so let's do node Amazon ab.js. This is a interlinked to monitor their ego, pasted their air in value or 00, 00, 00 xx. So quick air. If it's greater than or equal to 0, this is HTTPS or first thing, the index is 0. So you should be checking greater than, equal to 0. Silly mistakes, Ms. Lee mistakes. Okay. Basically it and then say now monitoring the input, the product link and see the monitored it in stock. Now after eight seconds or run again. Good quick wait. 7654321. There you go. And now our launcher, it successfully takes in the user input and it takes in the link Bay, want to monitor to good work everyone. We're almost there. I'll see you in the next video. 7. Creating Multiple Monitors: Welcome back everyone. In this video we will be creating multiple monitors using our program. So right now, our program or a monitor is only monitoring one product, right? We want our monitor to monitor multiple products because that's more practical, right? So we're going to do, is you're going to write up some new code to make sure our monitor monitors however many products they use it once. Okay. First we're gonna do, is we're gonna do this. We're going to product links. Let's rename the variable because we're not, we're no longer dealing with only one product or product link. We're doing with multiple enter least monitor. Okay? So at this point, we're going to do, since we have product links, right? There has to be some type of way or we can distinguish each link, right? Some type of way the user can input the links so we are able to find a common character that we can split the string and make it to an array. So in other words, var product links array equals product links dot split column. So this does, is basically creates an array by splitting each substring that separated by a comma. Right? Now this is assuming that the user separates the links that they want to monitor using a comma. So you can say actually links to monitor separate by comma. Okay? Now the thing is, what if the user inputs this link, right? What's the input? Https, WWW dot would like to spaces afterwards, right? That can mess things up. Puppeteer might not know which what space, space space is. A knows what is, but not space, space, space, right? So we're going to do, is we're gonna do some preprocessing of our array. So once you have, once you have the array of links, we're going to do for var I equals 0. And now you don't have to do this, but I recommend it in real-world programming late. If you go to like any job, they're gonna make sure you do this because you want to validate user input. The user should be smart, right? But, you know, we had some knucklehead uses some time then when you deal with them, you gotta, you gotta dumb it down. So we're going to do product links. Array I is equal to o dot trim. This separately, this takes out any leading or trailing spaces, right? So cost-based phase would just be calm. Okay? Yep, alright, cool. So we have our go. Okay, let's just test it out. So this console dot log product X3. So node Yes. Oh, okay. So agile links to monitor doses. Do this, pretend to link is a Google and space. Space. Space. Yep. There you go. See all the space. And before that came up, before the Yahoo is now taken out, right? That's what the trim does. So it makes it nice and neat. Okay, so we've got our product links or a set is preprocessed, it's all good. Okay, So now what we're gonna do, all right, how are we going to make our monitor, monitor multiple links. All right, so this is what's going to happen when we create array, call it monitors. Okay? And now for it terms of verbage, Let's just say that a one monitor is for one link. So we're making multiple monitors. I know this kinda sounds weird since this is all one grand monitor, but this bear with me desk will be, call it. Okay, cool. So now we're gonna do product links array. That for each link, we're going to create a promise. Okay? This is an asynchronous operation, dissolve, reject. Now, our return value doesn't really matter for this case. We're just gonna do is do monitor, like Okay. And then I'll resolve module link. If you're not understand promises, then there's always tutorials. Or I might make one for you guys. Dot catch error because the error that occurred is Console.log there. Okay, cool. So this doing is getting every single link and is calling them monitor method on that link, right? So each promise has its own link assigned to. It's doing its own work at a separate time. Now, NodeJS is single threaded. So like the concept of multithreading isn't actually there. That's not like C Sharp, but this, this close we can get Kinder. All right, so we got that. Now what we're gonna do right here, actually, we're gonna do monitors, push. A link for this is doing is it's adding it to the array. Now why are we adding, OH, oops, Push p, Sorry. Why are we adding each promised this array? Well, this monitors is an array of promises. I show said that before. Radio promises. Okay? And now what we do is we do this cause method, await. Promise, dot, all settled. This is 1, 0, 0 here creates a promise that resolves within an array results when all the provider promises resolve or reject. Now, because our module method is infinite, right? You'll always keep running again and again. This will never stop, right? This will always be waiting, awaiting because there are infinite loop, right? Each monitors continuously monitoring. So this will this will never return. Okay? And now we do all settled monitors. There you go. Okay. This is gonna do is like I said, it's going to be waiting for all the Manchus he finished monitoring, which never going to happen because we made our method infinite, which is what we want, because you don't want to continuously input command, you monitor, you just want to leave your monitor on and get the discord notification. Whenever you're not, maybe you're doing your homework for school and get a discount on application and you're like, Oh, is to install I mean by real quick. Okay. And yeah, this is, this should be it. Let's see. We only do this console log anymore. Okay, let's, let's actually test this out with a valid links. So we add this link right here. Let's get another link from Amazon real quick too. So we need, we just need this part here. Alright, so we're gonna pretend I just do this slash, slash comma, right? Core separate each link via a comma, and then they're OK. Save this. Now this happens a lot sometimes where when you paste it, all of a sudden you like a piece of 5 times is like really weird. Personally, I don't know how to fix this. I'm trying to fix this before. If you guys do know how to fix it and save our lives and convert it into a common section. Much appreciated. And I press Enter. There you go, See and stock in-stock. It says what? He actually let's make one more clear, think a little more clear. Let's say here, product name, because we all want to make sure we know what's talking about right. There you go. Oh, no, I better make sure it's monitoring both products. So let's see. I'm not convinced doc, this one is also in stock. And see right here. In this case, this link doesn't really have a name. The product doesn't have a name. We can probably me refresh it and get the actual name. No. Okay. So sometimes the link doesn't have a product name then on and that's kind of sad. Most links what our product name. If it doesn't, then you can edit the code. So it takes this title from the HTML. And the easing the HTML package. That's one thing you asked him, Do, you know, test it out. So we have this in stock and you have this installed. So you can see that we're monitoring two different items that were just good, which is exactly what we want. So that's how we make multiple monitors. Let's cancel that. Okay guys, so we accomplish our goal for this video. We made multiple monitors. In the next video, we will be integrating this into discord. 8. Discord Integration: Welcome back everyone. So in this video we will be integrating our monitor into discord because we wanted to screw notifications when your product is in stock. Okay, so for this to be accomplished, we're going to be using the Discord webhook node library, which is amazing. Like it's really amazing. There's a bunch of discord, no jet libraries out there. This is my favorite one, is very easy to use, very simple. So I'm going to do is go to this website right here. So you have to install this. So we do copy that. Let's clear this. I do npm install score but for node, okay, So we gotta installed, right? Once you got installed, all you have to do is just copy this part right here. Here. That you've got this part to get your paces at the top. All right. Put that over here. By the way, I did change my link to another item that she has a name just for simplicity purposes to make any more clear. But now over here we're going to have to input our webhook URL. You can get webhook URL from your own server. Personally, I have my own server on discord. So I'm going to do and to have a channel dedicated for this course, but I love this course so much. Yeah. Integrations, web hooks, view of books. They're copying the URL. And here and I'll paste it in there. There you. So why would the program runs? This is already set and everything is good. Okay? So you're going what things, some global thing, if you want to set for M, You can use this for reference. Right? Now you want to see exactly what we can do here. So let's title Amazon monitor dot set timestamp for sure. Timestamp, no matter what. What else do you want scholar, that make the color a light green? Let's do light green. X. That guy, google is your best friend when it comes to coding in Toronto, you Google on the stack overflow. All right, so you've got that. Got some water. All right, so this is all global stuff. We want every single level up to that. So now we want to edit a webhook depending on, you know, what a product is you're going to do. We're actually going to go to the website. Maximize this. I want our web hook to get the image. I want our webhook. Do you have the image? And you see right here, there's a capability. Where do you go? Where did it go? Ok. Dot set, Domino. Yes. So we're going to have our thumbnail me that this image right here. So I wanted to do that. We need to get the image source and how are we gonna do that? Well, spiced final selector for it. Div ID, okay. Okay, so right here, this is it, this is the holy grail for IDs landing image. So there's copies ID real quick. Copy. All right, So let product image E equal to root, query selector, landing image, attribute, source. Okay? This is the obviously your product image URL. Always name your variables correctly. So when it is n stock, right? We don't really care what's out-of-stock. We only notification saying, Hey, it's out of stock, like no one cares. We hear about when it's installed. You're going to do, and we're going to now create our Azure Web Hook create like the way it looks. So I have some predefined things on a one. So let's do and set thumbnail. Look at the set W or set image. Should we set them know you have a set image is something different. I'm pretty sure. Is that domino product image, URL and add feel what we want. Do you want to feel that says as a product name, right? So let's say HP laptop, whether it's in stock or whatever product link, right? Because we want name of the product and the link to the product. Because that way you're going to be just goes to the product and add to cart and check it out, right? And do you want a separate field, like is it inline? Do you wanted to separate field? Sure, sure, sure. Okay. Let's add another field. M dot at field. Oops. Okay. Availability, availability in stock. And we want, we want this on different lines. Do that, get false? Is that it? Yeah. Okay. So in order to send our bodies and our hook here, hooked us and that we owe. So when it's s dot, it will be sent to Europe. Okay. And that should be a Let's run it and test it out. Copy that over the terminal. Trust me everyone, The reason I love Node.JS so much is the fact that you can use all these libraries, right? Like everything is already made like this, where integrations already there. You can just quickly install it and just use it. It's amazing. We love APIs out here and library, I love it. Okay? Again, ignore this. We're air. I really wish and you have to solve this real quick. I do want to ask something until next to monitor. Over here. I want to do now monitoring us do land item. So this will say now monitoring three out of now monitoring tool, depending on how many, how many hours, how many ever product links you put in. Okay. That's just like South preference types of edges, nicer because I don't like seeing links and then I'll know what's going on. Okay. So it says in stock or both. Okay, So we should have got disqualification. Those cancel that. Let's see. Well, look at that. Well, you look at that. Well, you look at that. We got our ligand. This is beautiful. We got the HP Chromebook. So it looks like I wasn't able to get the flagship product image. I was able to get the HP Chromebook. We tried again. You missed us put, let's put one image in. Shoot. And just make sure. Okay, this pasted non-monetary one item. Okay, good, Well done discourse weird. When you send multiple workbooks in a row, like kinda, kinda blends together. It gets really awkward. So yeah, it's a reason it's not showing the image. Again, is because I think the image is already there for this one should be independent yet. And so that's what's looking like because it's the same. There's no there's no separate monitor or there is no separate web hook that's coming in as a same exact webhook. It's just like overlapping. Let us on Discord limitation, but it's working, right? It's perfect. You can see the image is available in stock. When we click it, it'll take me right to the product and then boom at the car and then yeah, I got my I got my thing as no, thanks. Okay. It's all good. It's all good. Let me cancel this before I was like, what's happening? Your discord is going crazy. So we got our integration working, the notification right there, and that's really it for this module. The next part where you packaging the monitor so you can maybe send to your friend or uses it on a separate computer. So we're going to do that in the next video. So think of watching piece. 9. Packaging Your Application: Welcome back everyone. So in this video we will be packaging our application. So if you want to send to your friend or anyone wants to use your application, they can use it. So in order to do this, you will be using another library. Yes, we always seen we love our libraries. This is an MPN library called EKG package. And what this does is it helps you really packaged application very simply, all you have to do is loop on this command and then run the command package space, the file name. They have it listed ri, somewhere here. I'll just show you guys because I'm a pro. So we have this, let's run this command npm install g package, right? Let it install it, just wait a bit. And once it's installed, all you have to do and trusting God, this is very simple. You use FTP KG, So package and then the file name. So in this case it's Amazon. So Amazon dot js, you press Enter. And if you don't specify a target package, that application to distribute it on Linux, Mac, and Windows. If your friend has a Windows laptop and you're coding on a Mac like I am, you can just send to them regardless. So now let's look at mining. See right here, amazon Mac OS. So to actually test it out and make sure everything is working, all you have to do is just copy this real quick. Copy this. You don't have to copy this, but just this is just to test. You go to the folder that I saw. You go to the folder where that your applications in Amazon monitor. You see the executable is right here. So I'll go to the macOS want I'm on a Mac. And there you go, is asking you to enter the links to monitor along. Do that. And obviously guys, We're error occurs, but It's wherever the error is to now mounting two items you see in stock, in-stock and we go to the discord and we will check now, in the monitors you got notifications. We did see right here, 536. 536. You've gotten notifications and the program is working fine in a standalone application. So now we can send this CLI app to our friends and use it on separate laptop. And that is how you package application NodeJS. Very simple, very easy, thanks to this package NPM library and that is it for this video. Thank you all for watching. 10. What's Next?: Graduation. So you have now successfully finished your Amazon development course. And now the possibilities are endless. You can create a mantra for any single website using the learning and processes you've picked up within this course. So now what's next? Where you create a monster for another website? Will you solve this monitor to other discourse and make a good amount of money or where you simply just improve this monitor and make sure it is fast and create a front end. Or the user can actually see a GUI and input stuff within text boxes and click checkboxes. The March of work differently. It's all up to you. So if you enjoy this course, be sure to leave a five-star review in the review section. Our greatly appreciated, I want to thank you all for sticking to the end of this course. That means a world to me, keep on coding, keep on succeeding, and stay frosty. Piece.