mirror of
https://github.com/opelly27/streetmerchant.git
synced 2026-05-20 02:57:34 +00:00
chore: update desc of variables (#101)
Signed-off-by: Jef LeCompte <jeffreylec@gmail.com>
This commit is contained in:
+7
-7
@@ -1,18 +1,18 @@
|
||||
EMAIL_USERNAME="youremail@gmail.com"
|
||||
EMAIL_PASSWORD="secretpassword"
|
||||
NOTIFICATION_TEST="false"
|
||||
OPEN_BROWSER="true"
|
||||
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"
|
||||
SHOW_ONLY_BRANDS="evga"
|
||||
SLACK_CHANNEL="SlackChannelName"
|
||||
SLACK_TOKEN="slack-token"
|
||||
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"
|
||||
TELEGRAM_ACCESS_TOKEN=""
|
||||
TELEGRAM_CHAT_ID="1234"
|
||||
SHOW_ONLY_BRANDS="evga"
|
||||
|
||||
@@ -56,33 +56,33 @@ At any point you want the program to stop, use <kbd>Ctrl</kbd> + <kbd>C</kbd>.
|
||||
|
||||
### 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:
|
||||
|
||||
| **Environment variable** | **Description** |
|
||||
|:---:|---|
|
||||
| `EMAIL_USERNAME` | Gmail address (e.g., `jensen.robbed.us@gmail.com`); optional |
|
||||
| `EMAIL_PASSWORD` | Gmail password; see below if you have MFA; optional |
|
||||
| `NOTIFICATION_TEST` | Test all the notifications configured; optional, default: `false` |
|
||||
| `PAGE_TIMEOUT` | Navigation Timeout in milliseconds (`0` for infinite); optional, default: `30000` |
|
||||
| `PHONE_NUMBER` | 10 digit phone number (e.g., `1234567890`); optional, email configuration required |
|
||||
| `PHONE_CARRIER` | [Supported carriers](#supported-carriers) for SMS; optional, email configuration required |
|
||||
| `RATE_LIMIT_TIMEOUT` | Rate limit timeout for each full store cycle; optional, default: `5000` |
|
||||
| `SHOW_ONLY_BRANDS` | If set, will only show specified brands, seperated by `,` |
|
||||
| `SLACK_CHANNEL` | Slack channel for posting (e.g., `update`); optional |
|
||||
| `SLACK_TOKEN` | Slack API token; optional |
|
||||
| `STORES` | [Supported stores](#supported-stores) you want to be scraped; optional, default: `nvidia` |
|
||||
| `OPEN_BROWSER` | Toggle for whether or not the browser should open when item is found, default: `true` |
|
||||
| `PLAY_SOUND` | Play this sound notification if a card is found.; optional |
|
||||
| `SCREENSHOT` | Capture screenshot of page on successful hit; optional, default `true` |
|
||||
| `TELEGRAM_ACCESS_TOKEN` | Telegram access token; optional |
|
||||
| `TELEGRAM_CHAT_ID` | Telegram chat ID; optional |
|
||||
| **Environment variable** | **Description** | **Notes** |
|
||||
|:---:|---|---|
|
||||
| `EMAIL_USERNAME` | Gmail address | E.g.: `jensen.robbed.us@gmail.com` |
|
||||
| `EMAIL_PASSWORD` | Gmail password | See below if you have MFA |
|
||||
| `NOTIFICATION_TEST` | Test all the notifications configured | Default: `false` |
|
||||
| `OPEN_BROWSER` | Toggle for whether or not the browser should open when item is found | Default: `true` |
|
||||
| `PAGE_TIMEOUT` | Navigation Timeout in milliseconds | `0` for infinite, default: `30000` |
|
||||
| `PHONE_NUMBER` | 10 digit phone number | E.g.: `1234567890`, email configuration required |
|
||||
| `PHONE_CARRIER` | [Supported carriers](#supported-carriers) for SMS | Email configuration required |
|
||||
| `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/) |
|
||||
| `PUSHOVER_TOKEN` | Pushover access token |
|
||||
| `PUSHOVER_USERNAME` | Pushover username |
|
||||
| `RATE_LIMIT_TIMEOUT` | Rate limit timeout for each full store cycle | Default: `5000` |
|
||||
| `SHOW_ONLY_BRANDS` | Filter to show specified brands | Comma separated, E.g.: `evga,zotac` |
|
||||
| `SLACK_CHANNEL` | Slack channel for posting | E.g., `update`, no need for `#` |
|
||||
| `SLACK_TOKEN` | Slack API token |
|
||||
| `STORES` | [Supported stores](#supported-stores) you want to be scraped | Comma separated, default: `nvidia` |
|
||||
| `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: Free sounds available [here](https://freesound.org/home/). Place sounds into `resources/sounds/`
|
||||
|
||||
#### Supported stores
|
||||
|
||||
| **Stores** | **Environment variable** |
|
||||
|
||||
+2
-2
@@ -23,8 +23,8 @@ const notifications = {
|
||||
},
|
||||
playSound: process.env.PLAY_SOUND ?? '',
|
||||
pushover: {
|
||||
token: process.env.PUSHOVER_TOKEN,
|
||||
user: process.env.PUSHOVER_USER
|
||||
token: process.env.PUSHOVER_TOKEN ?? '',
|
||||
user: process.env.PUSHOVER_USER ?? ''
|
||||
},
|
||||
slack: {
|
||||
channel: process.env.SLACK_CHANNEL ?? '',
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import playerLib = require('play-sound');
|
||||
import playerLib from 'play-sound';
|
||||
import {Config} from '../config';
|
||||
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();
|
||||
|
||||
export function playSound() {
|
||||
|
||||
Reference in New Issue
Block a user