go-find-liquor

command module
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2025 License: GPL-3.0 Imports: 1 Imported by: 0

README

go-find-liquor (GFL)

Oregon Liquor Search Notification Service using the OLCC Liquor Search website, Go, and the nikoksr/notify library.

Features

  • Search Oregon Liquor Search for specific liquor items
  • Search by product name or item code
  • Configurable search radius based on zip code
  • Automatic age verification handling
  • Random user agent rotation to avoid detection
  • Random delays between searches to simulate human behavior
  • Multiple notification methods:
    • Gotify (direct API integration)
    • Slack
    • Telegram
    • Discord
    • Pushover
    • Pushbullet
  • Configurable search interval
  • One-time or continuous search mode

Usage with Docker

Dockerized GFL uses a final image based on Distroless Debian static since it includes minimal dependencies but most crucially ca-certificates (which are needed to POST notifications to HTTPS endpoints).

cp config.example.yaml config.yaml
# edit config.yaml
make build run
Docker Compose
cp config.example.yaml config.yaml
# edit config.yaml
make up

Installation

# Clone the repository
git clone https://github.com/toozej/go-find-liquor.git
cd go-find-liquor

# Build the application
make local-build

Configuration

GFL can be configured using a YAML configuration file, environment variables, or command-line flags.

Configuration File

Create a config.yaml file in the same directory as the executable:

cp config.example.yaml out/config.yaml
Environment Variables

All configuration options can be set using environment variables with the GFL_ prefix:

export GFL_ITEMS="Blanton's,Eagle Rare,Buffalo Trace"
export GFL_ZIPCODE="97201"
export GFL_DISTANCE="15"
export GFL_INTERVAL="6h"
Command-Line Flags

Basic options can be set using command-line flags:

# Run in debug mode
./out/go-find-liquor -d

# Use a specific config file
./out/go-find-liquor -c /path/to/config.yaml

# Run search once and exit
./out/go-find-liquor -o

Usage Examples

Run a single search and exit
make local-run

# or alternatively without using the provided Makefile
./out/go-find-liquor --once
Run continuously with the default interval
./out/go-find-liquor
Run with a specific config file
./out/go-find-liquor --config /path/to/config.yaml
View version information
./out/go-find-liquor version
Generate man pages
./out/go-find-liquor man --dir /usr/local/share/man/man1

Notification Types

GFL supports multiple notification methods:

Gotify
notifications:
  - type: gotify
    endpoint: "https://gotify.example.com"
    credential:
      token: "YOUR_GOTIFY_TOKEN"
Slack
notifications:
  - type: slack
    credential:
      token: "YOUR_SLACK_TOKEN"
      channel_id: "https://exampleorg.slack.com/archives/XXXXXXXXXXXXXXXXXXXXXXXX"
Telegram
notifications:
  - type: telegram
    credential:
      token: "YOUR_TELEGRAM_BOT_TOKEN"
      chat_id: "YOUR_CHAT_ID"
Discord
notifications:
  - type: discord
    credential:
      webhook_url: "https://discord.com/api/webhooks/000000000000000000/XXXXXXXXXXXXXXXXXXXXX"
Pushover
notifications:
  - type: pushover
    credential:
      token: "YOUR_PUSHOVER_TOKEN"
      receipient_id: "XXXXXXXXXXXXX"
Pushbullet
notifications:
  - type: pushbullet
    credential:
      token: "YOUR_PUSHBULLET_TOKEN"
      device_nickname: "XXXXXXXXXXXXX"

Background

go-find-liquor, or GFL for short, was built since it is increasingly difficult to find some liquors at Oregon liquor stores due to short supply, mis-management, antiquated technology, etc. GFL was born to make it easier to find just the right bottle. Also, fun fact, GFL's alternative name is "good-fucking-luck", as in good luck finding those rare bottles ;).

changes required to update golang version

  • run ./scripts/update_golang_version.sh $NEW_VERSION_GOES_HERE

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
cmd
internal
pkg
man

Jump to

Keyboard shortcuts

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