Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/matthewoden/schnupons

A dumb script for a dumb name.
https://github.com/matthewoden/schnupons

Last synced: about 1 month ago
JSON representation

A dumb script for a dumb name.

Awesome Lists containing this project

README

        

# Schnupons

A puppeteer script that handles tedium around online coupons at my local grocer.

## Background

Our grocer offers online coupons. To use them, you present a barcode at checkout, and it applies all relevant coupons from towards whatever you're buying. On any given day, there's 150+ coupons available, and most of them aren't relevant. I don't want to scroll through them all to figure out if there's anything I need.

This little script logs in, "clips" every single coupon available, then exits.

## Requirements

- Node 10.15.1 or later.
- A [Schnucks](https://nourish.schnucks.com/) account

## Install

From the project directory, install and symlink the binary:

```
npm ci && npm link
```

For updates:

```
git pull && npm ci
```

## Usage

```
Usage: schnupons [options]

Options:
-V, --version output the version number
-u, --username Your account username
-p, --password Your account password
-t, --timeout amount of time to wait for completion account password. Defaults to 3600 (5 minutes)
-k, --iftttKey IFTTT.com webhook key. Used with the 'iftttEvent' option to dispatch notifications
and errors.
-e, --iftttEvent IFTTT.com webhook event name. Used to dispatch notifications and errors.
https://maker.ifttt.com/trigger/YOUR-EVENT/with/key/YOUR-KEY
-h, --help output usage information
```

## Example

```
# in cron sourcing current user profile
0 8 * * * bash -lc "schnupons --username $SCHNUPONS_USERNAME --password $SCHNUPONS_PASSWORD --timeout 3600 --iftttKey $IFTTT_WEBHOOK_KEY"
```

## Troubleshooting

On failure, there's an option to dispatch alerts to IFTTT, which you can send anywhere.
Otherwise, the last 14 days of logs are kept in `./logs`

## Tip

If you're running locally on osx - use pmset to ensure cron jobs wake your machine:

```bash
# cron job runs at 8:00am, so let's wake a little early
pmset repeat wakeorpoweron MTWRFSU 7:58:00
```