Giter Site home page Giter Site logo

tgtg's Introduction

TooGoodToGo Notifier

Never Miss a TooGoodToGo Box Again!

Actions Status

Introduction

The TooGoodToGo Notifier is a simple yet powerful application designed to keep you updated about available boxes from your favorite stores on TooGoodToGo. It automates the process of checking for boxes and sends notifications to your preferred platforms whenever a box becomes available.

Key Features

  • Instant notifications when your favorite TooGoodToGo stores have boxes available.
  • Flexibility to run the application as a one-time check or continuously in server mode with a customizable interval.
  • Option to utilize Redis for data storage, enabling stateless application runs.

Getting Started

Before using the application, you'll need your TooGoodToGo user ID and refresh token. If you don't have them yet, you can obtain them with this command:

$ tgtg auth

For Docker users, you can run the command within a Docker container:

$ docker run -it --rm ghcr.io/hugo-vrijswijk/tgtg:latest auth

The command will guide you through obtaining your user ID and refresh token.

Installation

You have two options for running the application:

  1. Download a Binary from the Latest Release: Release Page
  2. Use the Docker Image:
$ docker run ghcr.io/hugo-vrijswijk/tgtg:latest

Usage

The application operates in two modes:

  1. One-shot Mode: Checks for boxes once and then exits.
  2. Server Mode: Continuously monitors for boxes at a customizable interval (default: 5 minutes) without exiting.

To run the application, provide your TooGoodToGo user ID and refresh token as environment variables (TGTG_USER_ID and TGTG_REFRESH_TOKEN) or as arguments (--user-id and --refresh-token) and a notification provider.

For detailed information about available options, use the following command:

$ tgtg --help

Notifications

Choose your preferred notification platform for available box alerts:

  • Gotify: --gotify-url and --gotify-token.
  • Pushbullet: --pushbullet-token.
  • Pushover: --pushover-token and --pushover-user.
  • Custom Webhook URL: --webhook-url
    • This will send a POST request to the URL with a JSON body containing a title and message.

Each of these options can also be set as environment variables (in SCREAMING_SNAKE_CASE).

Utilizing Redis for Application State (advanced)

By default, tgtg stores authentication tokens and notification history cache in a local file named cache.json. For a stateless application, Redis can be used to manage this state.

To use Redis, specify the Redis host with the --redis-host option:

$ tgtg --redis-host <REDIS_HOST>

Alternatively, set the Redis host as an environment variable (REDIS_HOST).

Development

The TooGoodToGo Notifier was developed using the following technologies:

Acknowledgments

This application drew inspiration from tgtg-python. We express our gratitude to the developers of tgtg-python for their valuable contributions.

tgtg's People

Contributors

dependabot[bot] avatar github-actions[bot] avatar hugo-vrijswijk avatar scala-steward avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

scala-steward

tgtg's Issues

Exception when sending request: POST

Hi,
i'm using Windows 10 with latest version of tgtg.

My command line is the following:
tgtg-win-amd64.exe -r -u --webhook-url -s

I'm getting this error:
2024-01-05 12:45:01 ←[31m←[47m[ERROR]←[0m ←[35mtgtg.LogWrapper:25←[0m: Exception when sending request: POST https://apptoogoodtogo.com/api/item/v8/, took: 0.234s sttp.client4.SttpClientException$ReadException: Exception when sending request: POST https://apptoogoodtogo.com/api/item/v8/ ←[35m←[0m
2024-01-05 12:45:01 ←[31m←[47m[ERROR]←[0m ←[35mtgtg.Main$:45←[0m: Exception when sending request: POST https://apptoogoodtogo.com/api/item/v8/ ←[35m←[0m
2024-01-05 12:45:01 ←[31m←[47m[ERROR]←[0m ←[35mtgtg.Main$:45←[0m: Caused by: sttp.client4.DeserializationException: DecodingFailure at .items[0].price_including_taxes: Missing required field ←[35m←[0m

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.