GithubHelp home page GithubHelp logo

xiepoder / productsarrivalnotices Goto Github PK

View Code? Open in Web Editor NEW

This project forked from zhou-1/productsarrivalnotices

0.0 0.0 0.0 5.43 MB

During this serious Coronavirus period, hope my Arrival Notices project for products (like surgical mask :mask:, hand sanitizer :open_hands:, Medical Exam Gloves :snowman:) in market (Amazon) can help a little bit. :heart:

Python 100.00%

productsarrivalnotices's Introduction

During this serious Coronavirus period, hope my Arrival Notices project for products (like surgical mask ๐Ÿ˜ท, hand sanitizer ๐Ÿ‘, Medical Exam Gloves โ›„) in market (Amazon) can help a little bit. โค๏ธ
Ppl can also add in amazon links for their favorite products like toliet paper, switch if they like.


ProductsArrivalNotices

[Current Version - V3]

  1. This project can help you check whether 3 kinds (face mask, hand sanitizer, Medical Exam Gloves) of good-quality products (5 best sellers) in Amazon for protecting yourself in serious coronavirus period can be purchased now or not.
  2. This project can help you detect the process of product in a while loop, it will send you email automatically and repeatedly until you shuts down the program.
  3. This project can automaticly detect and update 5 best-seller links from best-seller products page (like the link below: https://www.amazon.com/Best-Sellers-Industrial-Scientific-Medical-Exam-Gloves/zgbs/industrial/8404645011) for 3 medical category in Amazon.
  4. This project allows user to store privacy information in a text, my main program can extract infromation from text.
  5. This project can let user type in link(s) for their ideal products.

[First Version & Second Version - V1 & V2]

  1. This project can help you check whether 3 kinds (face mask, hand sanitizer, Medical Exam Gloves) of good-quality products (5 best sellers) in Amazon for protecting yourself in serious coronavirus period can be purchased now or not.
  2. This project can help you detect the process of product in a while loop, it will send you email automatically and repeatedly until you shuts down the program.
  3. This project can automaticly detect and update 5 best-seller links from best-seller products page (like the link below: https://www.amazon.com/Best-Sellers-Industrial-Scientific-Medical-Exam-Gloves/zgbs/industrial/8404645011) for 3 medical category in Amazon.

Demo

Demo video for current version can be viewed here.
Demo video for V2 can be viewed here.
Demo video for V1 can be viewed here.

Images gallery

Demo images for this project can viewed below.

Content of email will be looked like below:

v1-img1

Current attachment looks like below:

v1-img4

Previous attachment looks like below:

Version 2:

v1-img3

Version 1:

v1-img2

How to set up this project?

First, please clone/download my project.

git clone https://github.com/zhou-1/productsArrivalNotices.git    

Second, in main_program_V3/info.txt file, (Please see the comments at the top of txt file carefully!!) add in your own gmail address, password of your gmail, and email address you would like to send email to.

TO=/[email protected]/
gmail_sender=/[email protected]/
gmail_passwd=/**********/

Third (optional), in main_program_V3/main.py file, you can also change the contents for subject, text of email if you like:

# email subject
SUBJECT = 'Here is the summary for products you are interested in!!'
# contents of email
# Send an attachment for report
TEXT = "Please download the attached txt file for your report."

Third, in your terminal, type in:

python main.py     

The program will run automatically and repeatedly; everytime when my program finishes one round, it will send an email with report as attachment to your "receive" email.

What you need?

Python 3
Libraries needed in Python:

  1. requests
  2. time
  3. smtplib
  4. email
  5. lxml
  6. re
  7. sys

Core parts

Currently, there are 3 core parts in my program.

1. Send email in Gmail with Python

Send email in gmail account with Python.
Here will be one popular quetion for "Login credentials with Gmail SMTP".
You could change the security level for SMTP Authentication Error in this link: https://support.google.com/accounts/answer/6010255
If you find the current status of security level is off like below image shows:
lsa1
After you trun on the security level, the status will show like velow image:
lsa2

2. Check availiabilty in website (Amazon)

Checking availaility in amazon website with product's ID.

# checking availaility 
XPATH_AVAILABILITY = '//div[@id ="availability"]//text()'
RAw_AVAILABILITY = doc.xpath(XPATH_AVAILABILITY) 
AVAILABILITY = ''.join(RAw_AVAILABILITY).strip()

This will return the result of product's availabilty based on its ID.

3. Check Top 5 products from Amazon's Best Seller page

Checking Top 5 best seller products from recommanded page.

# check for product link in href
XPATH_HREF = '//span[@class = "aok-inline-block zg-item"]/a[@class ="a-link-normal"]/@href'
RAw_HREF = doc.xpath(XPATH_HREF) 
#print(type(RAw_HREF)) # list

This will return a list for links for those 5 best-seller products.

productsarrivalnotices's People

Contributors

zhou-1 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.