Build Your Own Python App To Track Amazon Prices
I was tired to have to check for the item myself. Now, this app does it for me and sends me notifications when it finds what I needed
As time goes on, I have less time to spend online. I’m always thinking and searching for new ways to automate whatever is that I need. If you are like me, keep reading. This project may help you in gaining more free time for yourself.
Note: This can also be used for other sites, not just Amazon.
I love buying random stuff online. To be honest, I can’t remember when was the last time I went shopping at a place like a mall. Not an easy task to do when you have to work, go to the gym, walk your dog, and deal with an angry girlfriend at home.
The Plan 📐
Like when you go to a store, you have to go around searching for the right prices. There is no difference when searching items on amazon, maybe worst, since they are thousands with different prices and model derivation. For this reason, I decided to build an app that will do the task for me. All I have to do is feed it with whatever I need. Once it finds the right price, I want this app to let me know by sending me an email as a notification.
I will not be disclosing too many details about coding. I assume you know your way around Python. If not, take a look at Python
App Code 📝
App Structure 🔬
* Line 8 frommail: This will be the mail used to send the notifications.
* Line 9 passwd: The generated password from your google Gmail “App passwords” option.
* Line 10 tomail: This will be the mail receiving the notifications.
* Line 12 URL : The link to the product you want.
* Line 14 headers: add your browser information ex: Mozilla/5.0 (Macintosh; Intel Mac OS X 9.11; rv:69.0) Gecko/20100101 Firefox/68.0
* Line 26 converted_price: The price you are willing to pay.
* Line 31 server: smltplib.STMP service of your mail.
* Line 51 time.sleep: This will be the time used to run your App on. for more information on how this work click here time.sleep()
As you can see, this is a simple app, self-explanatory. Modify the code to meet all your needs.
Create an Amazon Linux instance in Lightsail 💻
Using Lightsail make a Linux virtual server to run this app all day. It will also give you the commodity of monitoring everything from your phone, without the need for a PC.
1. In aws.amazon.com go to AWS Management Console >Lightsail.
2. Once in Lightsail choose create instance
3. Choose Change Region and Availability Zone for your instance
4. Next, choose the Amazon Linux blueprint option.
5. (Optional) Choose Change SSH key pair to select, create, or upload the key pair you would like to use to SSH into your instance.
6. Pick a name for your instance
7. Last, Create instance.
Connect to it and within minutes, your Amazon Linux instance will be ready, and you can connect to it using the browser-based SSH terminal in the Lightsail console. You can use SSH client such as PuTTy. Use this link to learn how to use it with your instance. You will need this to update your App with new items, prices. To connect using your phone just download any SSH client app from Android Play Store or Apple Store.
Final Thought and Recommendation 🗣
When using Gmail.com remember to first active “Less secure app access” and “create an app password” google service. Sending mail limits are 2,000 mails per day.
🛒 Let's go shopping!
About the Creator
c0d3x27
🐵Top Writer |Cybersecurity|YouTuber| Gym rat| Sport Bike Rider by day, Bug Hunter by night |#InfoSec #BugBounty #Fitness #Gym #Programming #Coder


Comments
There are no comments for this story
Be the first to respond and start the conversation.