Package: amazon-wishlist-pricewatch
Amazon Wishlist PricewatchPeriodically check your public Amazon wishlist for price reductions.This package will send you a notification (SMTP email and/or telegram) each time a product on yourpublicly availablewishlist reaches a new lowest price. Price still not low enough? You'll only receive another notification for the same product when the price drops further.Pip install the package, fill in the configuration file and schedule to run with your preferred task scheduler. E.g. Windows Task Scheduler / launchd (Mac OS) / cron (Mac OS / Unix).Uses the wonderfulrequestsandBeautifulSoup4. No need for the overhead of a headless browser as all data can be gathered from the plain html.Table of ContentsHow It WorksGetting StartedPrerequisitesInstallationSet ConfigurationTest NotificationsSet Running ScheduleWindowsMac OSUnix/LinuxConfig File DocumentationNotification ModeSend Test NotificationUsing GmailUsing TelegramUser AgentQuestions, Suggestions and BugsContributing / DevelopmentLicenseHow It WorksOnce installed and configured, each run ofpricewatchdownloads and stores your wishlist as JSON and does price comparisons against items seen in previous runs. When a new lowest price for a product is seen you receive a notification, and the new price is saved to JSON for future runs.Schedule the script to run as often as you like with Task Scheduler/launchd/cron, and you're good to go.Getting StartedPrerequisitesPython >=3.8InstallationInstall with pip (recommended):pip install amazon-wishlist-pricewatchpricewatchOr clone the git repo:git clone https://github.com/sam0jones0/amazon_wishlist_pricewatch.gitcd amazon_wishlist_pricewatchpip install -r requirements.txtcd ./amazon_wishlist_pricewatchpython3 ./pricewatch.py(Optional) If you want telegram notifications:pip install python-telegram-botSet ConfigurationFill in the config file located atamazon_wishlist_pricewatch/config.jsonIf you can't find it enterpricewatch(orpython3 ./pricewatch.pyif you cloned the repo) into your console. Location of the file will be printed.Detailed config file documentationhere.Test NotificationsInconfig.jsonSetsend_test_notificationto "1" and runpricewatch. A test notification(s) should be sent and pricewatch will exit. Remember to set back to "0" once you're done.Set Running ScheduleYou can use any task scheduler you like to runpricewatch/pricewatch.pyHere's a few suggestions.WindowsI recommend using "Windows Task Scheduler". You can use the GUI or for e.g. to create a task that runs once each time the system boots enter the following into an elevated (Run as Administrator) cmd.exe/Powershell.schtasks /create /tn "Amazon Wishlist Pricewatch" /tr "C:\Path\To\Your\Python\exe\python.exe D:\Path\To\amazon-wishlist-pricewatch\amazon_wishlist_pricewatch\pricewatch.py" /sc onstart /RU WindowsUserName /RP WindowsPasswordMore examples and guidance on setting different scheduleshereMac OSYou can use cron, launchd, automator or any other tool. For e.g. to use launchd to create a task that runs once each time the system boots create
the following file~/Library/LaunchAgents/local.amazonwishlistpricewatch.pricewatch.plistand paste in:<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"><plistversion="1.0"><dict><key>Label</key><string>local.amazonwishlistpricewatch.pricewatch.plist</string><key>ProgramArguments</key><array><string>/usr/local/bin/python3</string><string>/path/to/amazon_wishlist_pricewatch/pricewatch.py</string></array><key>RunAtLoad</key><true/></dict></plist>More information on launchdhereUnix/LinuxI assume you'll be fine! Perhaps use cron.Config File DocumentationAnnotated example config file contents:{"general":{"notification_mode":"12 (1 for email + 2 for telegram)","wishlist_url":"https://www.amazon.co.uk/hz/wishlist/ls/S0M3C0D3","user_agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:87.0) Gecko/20100101 Firefox/87.0","send_test_notification":"0"},"email":{"smtp_server":"YOUR-SMTP-SERVER (e.g. smtp.gmail.com)","smtp_port":"YOUR-SMTP-SSL-PORT (e.g. 465 for gmail)","sending_email":"SENDING EMAIL ADDRESS (e.g. example@gmail.com)","sending_email_pass":"SENDING EMAIL ADDRESS PASSWORD","receiving_emails":["person1@gmail.com","person2@optional.com"]},"telegram":{"chat_id":"1234567890","token":"9876543210:HFusj898IEXAMPLEHDKEIIE83exampleuUJ"}}Notification Mode"1" for email."2" for Telegram."12" for email and Telegram.Send Test NotificationSet to "1" to have the script attempt to send a notification to each method specified and then exit. Change back to "0" to have the script run normally.Using GmailIf you have 2FA enabled you cancreate an app passwordand put that insending_email_pass.Not recommended, but you can use your usual Google account password if youenable "Less secure app access". I'd recommend creating a new Gmail account if you do this.Using TelegramDownload / install Telegram.Create a bot withTelegram's BotFather botand keep a note of the token.Create a new group where you will receive notifications and add your new bot to it.Send at least one message to the group.Visithttps://api.telegram.org/botXXX:YYYYY/getUpdatesreplacing XXX:YYYYY with your token from step 2 and take a note of thechatid.Add your chat id and token to config.json.User AgentYou don't need to change this, but you can. Enter "my user agent" into Google to see your browser's user agent.Questions, Suggestions and BugsFeel free to open an issuehere.Contributing / DevelopmentContributions welcome.Clone the repo andpip install -r requirements_dev.txtin a new virtual environment.Uses pytest for testing, Mypy for type checking, and black for code formatting.LicenseMIT License. Sam Jones