Skip to content

A simple bot to monitor prices of online items and notify you via Slack if the price drops

Notifications You must be signed in to change notification settings

creatingsapien/slack_price_bot

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Slack Price Monitoring Bot

A simple bot that monitors the price of user-defined items at online stores.

To Use

Requirements

  • Beautiful Soup, Requests, Regex, Slack client
  • Hickory for scheduling via command line

Modifications

  • The utils.py file contains the actual price monitoring function - it is likely that the items you want to monitor are not the same HTML format of the items I built this to monitor. Therefore, you would have to modify the scraper function to isolate the item price and title to work for the specific items you want to monitor. You will also have to create separate scraper functions in the utils.py file to monitor items on different websites as its unlikely that their webpage code is identical. Nevertheless, the main slack_price_scraper.py script can call multiple scraper functions.

How to use

  • Once you have modified the functions in the utils.py file to work for the items you need (it is likely you will need to create more/less functions for the various web stores you want to monitor items on), in the slack_price_scraper.pyfile you call the individual functions and insert the URL of the item you want to monitor in the first argument of the respective function.
  • The empty prices.json dictionary acts as the store for the previous price point. Every time slack_price_scraper.py is called, it compares the latest price with the previous price (stored in the dictionary) and will send a message to your desired Slack channel if it drops below the previous price. It then updates the dictionary. If there has been no price change, then no notifications will be sent. If a new item is added, it will update the dictionary with the new items and their associated prices.
  • Schedule via Hickory i.e. at command line hickory schedule slack_price_scraper3.py --every=10mins etc.
  • Add to Slack and add token to the command in the slack_price_scraper.py.
  • Add your browser header information (Google 'my user agent' to get this) to the header variable.

About

A simple bot to monitor prices of online items and notify you via Slack if the price drops

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%