Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lanlanblue/ikea-stock-notifier
A notifier that lets users subscribe to their favorite IKEA products which are unavailable. This notifier will crawl the stock status every hour and notify users immediately once the products are back to the stock.
https://github.com/lanlanblue/ikea-stock-notifier
Last synced: 3 months ago
JSON representation
A notifier that lets users subscribe to their favorite IKEA products which are unavailable. This notifier will crawl the stock status every hour and notify users immediately once the products are back to the stock.
- Host: GitHub
- URL: https://github.com/lanlanblue/ikea-stock-notifier
- Owner: lanlanblue
- Created: 2020-07-17T00:38:06.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-05-23T00:02:02.000Z (over 1 year ago)
- Last Synced: 2024-01-23T08:18:25.833Z (10 months ago)
- Language: HTML
- Homepage: https://ikea-notifier.herokuapp.com
- Size: 13.5 MB
- Stars: 3
- Watchers: 1
- Forks: 3
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ikea-stock-notifier
A notifier that lets users subscribe to their favorite IKEA products which are out of stock. This notifier will crawl the stock status every hour and notify users immediately once the product is back in stock.
![demo1.png](https://github.com/lanlanblue/ikea-stock-notifier/blob/master/demo1.png)## Usage
Subscribe to be notified when the product is in stock by pasting the product URL and providing your email address. You can unsubscribe from the notifications using the provided link in the email notification.
![demo3.png](https://github.com/lanlanblue/ikea-stock-notifier/blob/master/demo3.png)## Features
- Crawler for crawling data from the stock database
- RESTful API
- Insert subscribed items into the database
- Remove items based on _id## Deployment Guide
- Platform: Heroku
- Database: Mongodb at mLab1. Clone this project to your local workspace
```
$ git clone https://github.com/lanlanblue/ikea-stock-notifier.git
```
2. Create your Heroku account and download Heroku CLIPlease follow this guide [The Heroku CLI \| Heroku Dev Center](https://devcenter.heroku.com/articles/heroku-cli)
For MacOS
```
$ brew tap heroku/brew && brew install heroku
```
3. Create a DB on mLab
- Register on [MongoDB Hosting: Database-as-a-Service by mLab](https://mlab.com/home)
- Create a DB called "ikea_products"
- Add 2 collections under this DB
- users
- stocks
- Setup DB user & password
You can find your MongoDB link on the top of page.
4. Setup your gmail for notification
Please follow the steps in the link below, and copy the password that gmail service generates for you.
[How to Use Your Gmail Account as Your Email Sender via SMTP](https://www.jotform.com/help/392-How-to-Use-Your-Gmail-Account-as-Your-Email-Sender-via-SMTP)5. Create 2 apps on Heroku
Create apps with app names. The app name will be part of domain name used in later step.
```
$ cd ikea-stock-notifier
$ heroku create ikea-crawler --buildpack heroku/python --remote ikea-crawler
$ heroku create ikea-notifier --buildpack heroku/python --remote ikea-notifier
```6. Set config vars for both apps
You can either set config vars by following commands or set them on Heroku Dashboard
https://devcenter.heroku.com/articles/config-vars
```
# set up for ikea-crawler app
$ heroku config:set DATABASEURL="/ikea_products?retryWrites=false" --app=ikea-crawler
$ heroku config:set DOMAIN="" --app=ikea-crawler
$ heroku config:set MAILACCOUNT="" --app=ikea-crawler
$ heroku config:set MAILPASSWD="" --app=ikea-crawler
#setup for ikea-notifier app
$ heroku config:set DATABASEURL="/ikea_products?retryWrites=false" --app=ikea-notifier
$ heroku config:set DOMAIN="" --app=ikea-notifier
```
\: Please find the MongoDB link on mlab
ex. mongodb://:@XXX.mlab.com:port#
\: The domain name of ikea-notifier can be found by the following command
```
$ heroku domains --app ikea-notifier
```
7. Deploy the code```
# under ikea-stock-notifier
$ git subtree push --prefix crawler ikea-crawler master
$ git subtree push --prefix notifier ikea-notifier master
$ heroku ps:scale clock=1 --app ikea-crawler1
```