chore: update desc of variables (#101)

Signed-off-by: Jef LeCompte <jeffreylec@gmail.com>
This commit is contained in:
Jef LeCompte
2020-09-20 09:15:57 -04:00
committed by GitHub
parent 103d96dc81
commit 85faaa1ca7
4 changed files with 33 additions and 33 deletions
+7 -7
View File
@@ -1,18 +1,18 @@
EMAIL_USERNAME="youremail@gmail.com" EMAIL_USERNAME="youremail@gmail.com"
EMAIL_PASSWORD="secretpassword" EMAIL_PASSWORD="secretpassword"
NOTIFICATION_TEST="false" NOTIFICATION_TEST="false"
OPEN_BROWSER="true"
PAGE_TIMEOUT="30000" PAGE_TIMEOUT="30000"
PHONE_NUMBER="1234567890"
PHONE_CARRIER="tmobile"
PLAY_SOUND="notification.mp3"
PUSHOVER_TOKEN="123pushover-token456"
PUSHOVER_USER="123pushover-user-key"
RATE_LIMIT_TIMEOUT="5000" RATE_LIMIT_TIMEOUT="5000"
SHOW_ONLY_BRANDS="evga"
SLACK_CHANNEL="SlackChannelName" SLACK_CHANNEL="SlackChannelName"
SLACK_TOKEN="slack-token" SLACK_TOKEN="slack-token"
STORES="bestbuy,bandh,nvidia" STORES="bestbuy,bandh,nvidia"
PHONE_NUMBER="1234567890"
PHONE_CARRIER="tmobile"
PUSHOVER_TOKEN="123pushover-token456"
PUSHOVER_USER="123pushover-user-key"
OPEN_BROWSER="true"
PLAY_SOUND="false"
SCREENSHOT="true" SCREENSHOT="true"
TELEGRAM_ACCESS_TOKEN="" TELEGRAM_ACCESS_TOKEN=""
TELEGRAM_CHAT_ID="1234" TELEGRAM_CHAT_ID="1234"
SHOW_ONLY_BRANDS="evga"
+21 -21
View File
@@ -56,33 +56,33 @@ At any point you want the program to stop, use <kbd>Ctrl</kbd> + <kbd>C</kbd>.
### Customization ### Customization
To customize `nvidia-snatcher`, make a copy of `.env-example` as `.env` and make any changes to your liking. To customize `nvidia-snatcher`, make a copy of `.env-example` as `.env` and make any changes to your liking. _Note that all environment variables are **optional**._
Here is a list of variables that you can use to customize your newly copied `.env` file: Here is a list of variables that you can use to customize your newly copied `.env` file:
| **Environment variable** | **Description** | | **Environment variable** | **Description** | **Notes** |
|:---:|---| |:---:|---|---|
| `EMAIL_USERNAME` | Gmail address (e.g., `jensen.robbed.us@gmail.com`); optional | | `EMAIL_USERNAME` | Gmail address | E.g.: `jensen.robbed.us@gmail.com` |
| `EMAIL_PASSWORD` | Gmail password; see below if you have MFA; optional | | `EMAIL_PASSWORD` | Gmail password | See below if you have MFA |
| `NOTIFICATION_TEST` | Test all the notifications configured; optional, default: `false` | | `NOTIFICATION_TEST` | Test all the notifications configured | Default: `false` |
| `PAGE_TIMEOUT` | Navigation Timeout in milliseconds (`0` for infinite); optional, default: `30000` | | `OPEN_BROWSER` | Toggle for whether or not the browser should open when item is found | Default: `true` |
| `PHONE_NUMBER` | 10 digit phone number (e.g., `1234567890`); optional, email configuration required | | `PAGE_TIMEOUT` | Navigation Timeout in milliseconds | `0` for infinite, default: `30000` |
| `PHONE_CARRIER` | [Supported carriers](#supported-carriers) for SMS; optional, email configuration required | | `PHONE_NUMBER` | 10 digit phone number | E.g.: `1234567890`, email configuration required |
| `RATE_LIMIT_TIMEOUT` | Rate limit timeout for each full store cycle; optional, default: `5000` | | `PHONE_CARRIER` | [Supported carriers](#supported-carriers) for SMS | Email configuration required |
| `SHOW_ONLY_BRANDS` | If set, will only show specified brands, seperated by `,` | | `PLAY_SOUND` | Play this sound notification if a card is found | E.g.: `path/to/notification.wav`, valid formats: wav, mp3, flac, [free sounds available](https://notificationsounds.com/) |
| `SLACK_CHANNEL` | Slack channel for posting (e.g., `update`); optional | | `PUSHOVER_TOKEN` | Pushover access token |
| `SLACK_TOKEN` | Slack API token; optional | | `PUSHOVER_USERNAME` | Pushover username |
| `STORES` | [Supported stores](#supported-stores) you want to be scraped; optional, default: `nvidia` | | `RATE_LIMIT_TIMEOUT` | Rate limit timeout for each full store cycle | Default: `5000` |
| `OPEN_BROWSER` | Toggle for whether or not the browser should open when item is found, default: `true` | | `SHOW_ONLY_BRANDS` | Filter to show specified brands | Comma separated, E.g.: `evga,zotac` |
| `PLAY_SOUND` | Play this sound notification if a card is found.; optional | | `SLACK_CHANNEL` | Slack channel for posting | E.g., `update`, no need for `#` |
| `SCREENSHOT` | Capture screenshot of page on successful hit; optional, default `true` | | `SLACK_TOKEN` | Slack API token |
| `TELEGRAM_ACCESS_TOKEN` | Telegram access token; optional | | `STORES` | [Supported stores](#supported-stores) you want to be scraped | Comma separated, default: `nvidia` |
| `TELEGRAM_CHAT_ID` | Telegram chat ID; optional | | `SCREENSHOT` | Capture screenshot of page if a card is found | Default: `true` |
| `TELEGRAM_ACCESS_TOKEN` | Telegram access token |
| `TELEGRAM_CHAT_ID` | Telegram chat ID |
> :point_right: If you have multi-factor authentication (MFA), you will need to create an [app password](https://myaccount.google.com/apppasswords) and use this instead of your Gmail password. > :point_right: If you have multi-factor authentication (MFA), you will need to create an [app password](https://myaccount.google.com/apppasswords) and use this instead of your Gmail password.
> :point_right: Free sounds available [here](https://freesound.org/home/). Place sounds into `resources/sounds/`
#### Supported stores #### Supported stores
| **Stores** | **Environment variable** | | **Stores** | **Environment variable** |
+2 -2
View File
@@ -23,8 +23,8 @@ const notifications = {
}, },
playSound: process.env.PLAY_SOUND ?? '', playSound: process.env.PLAY_SOUND ?? '',
pushover: { pushover: {
token: process.env.PUSHOVER_TOKEN, token: process.env.PUSHOVER_TOKEN ?? '',
user: process.env.PUSHOVER_USER user: process.env.PUSHOVER_USER ?? ''
}, },
slack: { slack: {
channel: process.env.SLACK_CHANNEL ?? '', channel: process.env.SLACK_CHANNEL ?? '',
+3 -3
View File
@@ -1,9 +1,9 @@
import playerLib = require('play-sound'); import playerLib from 'play-sound';
import {Config} from '../config'; import {Config} from '../config';
import {Logger} from '../logger'; import {Logger} from '../logger';
import * as fs from 'fs'; import fs from 'fs';
const notificationSound = './resources/sounds/' + Config.notifications.playSound; const notificationSound = Config.notifications.playSound;
const player = playerLib(); const player = playerLib();
export function playSound() { export function playSound() {