shoe-price-checker

command module
v0.0.0-...-2855a90 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 4, 2023 License: MIT Imports: 12 Imported by: 0

README

Shoe price checker

Sends an email, via Gmail, if a shoe meets a price/query threshold.

Setup

Setup involves:

  • Visiting Running Wearhouse to get the Solr query (see below)
  • Configuring a .env file where the settings are stored
Find the Solr query URL
  1. Visit Running Warehouse, bring up the Network Monitor (ctrl+shift+e in Firefox)
  2. Sort the File column alphabetically and look for solr_query.php?search=<whatever>
  3. Copy the query URL for use in the QUERY_URL setting (e.g. https://static.runningwarehouse.com/solr/solr_query.php?search=products&brand_str%5B%5D=Altra&facet_base_MSTFIL%5B%5D=facet_value_MTRAILCOND&filter_cat=SALEMS&filter_set=MSFILTER)
Configuring .env

Create a .env file in the application's working directory that looks something like:

QUERY_URL="your_query"  # Use quotes.
THRESHOLD_PRICE=some_dollar_value
RECIPIENT_EMAIL=to_whatever_email_address
FROM_GMAIL=from_gmail_address
FROM_GMAIL_APP_PASSWORD=whatever_app_password

Note: QUERY_URL can contain multiple comma separated queries. See the following example.

For example:

QUERY_URL="https://static.runningwarehouse.com/solr/solr_query.php?search=products&brand_str%5B%5D=Altra&facet_base_MSTFIL%5B%5D=facet_value_MTRAILCOND&filter_cat=SALEMS&filter_set=MSFILTER, https://static.runningwarehouse.com/solr/solr_query.php?search=products&brand_str%5B%5D=HOKA&filter_cat=SALEMS&filter_set=MSFILTER"
THRESHOLD_PRICE=75
RECIPIENT_EMAIL=my_address@gmail.com
FROM_GMAIL=perhaps_the_same_email@gmail.com
FROM_GMAIL_APP_PASSWORD=whatever_app_password

Installation

Get the source and compile it:

$ git clone git@github.com:scottbarnes/shoe-price-checker`  # or `git clone https://github.com/scottbarnes/shoe-price-checker`
$ cd shoe-price-checker
$ go build -buildvcs=false

Then fill in .env with some settings (see above).

Then run the script from cron somehow. E.g.: crontab -e

0 7 * * * cd ~/code/shoe-price-checker && ./shoe-price-checker

Note, don't forget to cd to the directory with the binary and .env.

Misc

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL