Skip to content

Commit

Permalink
Improve readme
Browse files Browse the repository at this point in the history
  • Loading branch information
duboiss committed Apr 29, 2021
1 parent a1b8e3e commit 08dd583
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ Be notified when the desired price is reached.
Made in France.

## Requirements and installation
You need PHP 8.0 (or higher) and some [extensions enabled](https://symfony.com/doc/5.2/setup.html#technical-requirements) and composer.
You need PHP 8.0 (or higher) with some [extensions enabled](https://symfony.com/doc/5.2/setup.html#technical-requirements) and composer.
```sh
git clone git@github.com:duboiss/SymPriceAlert.git
cd SymPriceAlert

composer install
```

Fill the following environement variables in a new .env.local file.
Fill the following environement variables in a new `.env.local` file.
You need a Twilio account unless you want to use another provider or not receive SMS.

```env
Expand All @@ -28,7 +28,7 @@ PHONE_NUMBER=+33600000000
## Configuration
Each website you want to follow need a file in `src/DataProducts` folder.
Two keys are expected:
* selector: a DomCrawler selector
* selector: a [DomCrawler selector](https://symfony.com/doc/current/components/dom_crawler.html#node-filtering)
* products: an array of products

For each product, three keys are expected:
Expand All @@ -50,7 +50,7 @@ If the price is equal or lower than the desired price, three options:
3) The user has already been notified for this price drop but this one is even more important, he is notified.

## Exemple with Amazon
Just create a **amazon.json** file with the following structure and it's done.
Just create a **amazon.json** file in the `src/DataProducts` folder with the following structure and it's done.
```sh
# src/DataProducts/amazon.json
{
Expand All @@ -71,7 +71,7 @@ Just create a **amazon.json** file with the following structure and it's done.
```

## How it works
SymPriceAlert uses mainly [HTTP Client](https://symfony.com/doc/current/http_client.html), [DomCrawler](https://symfony.com/doc/5.2/components/dom_crawler.html) and [Notifier](https://symfony.com/doc/5.2/notifier.html) components.
SymPriceAlert uses mainly [HTTP Client](https://symfony.com/doc/5.2/http_client.html), [DomCrawler](https://symfony.com/doc/5.2/components/dom_crawler.html) and [Notifier](https://symfony.com/doc/5.2/notifier.html) components.

A request is made on the page to be analyzed to retrieve the current price.

Expand All @@ -81,5 +81,6 @@ A sleep is performed between each request to avoid the effects of rate limiting

### Notifications
By default an email and a SMS are sent but you can easily change this. The channels are adjustable in `config/packages/notifier.yaml`.
The cannel used is `hight`.

Look at the [documentation](https://symfony.com/doc/5.2/notifier.html) for more information.

0 comments on commit 08dd583

Please sign in to comment.