Skip to content

PraneGIT/lichess-notifier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lichess Notifier


Overview

Lichess Notifier is a Go-based application that fetches games from Lichess.org for specified users and sends email notifications when a game is lost. This project demonstrates the use of concurrent programming, signal handling, and email notifications in Go (that i made to troll my friends).


Prerequisites

  1. Enable "Allow less secure apps" or generate an App Password for your Gmail account.

Setup Instructions

1. Clone the Repository

git clone https://github.com/PraneGIT/lichess-notifier.git
cd lichess-notifier

2. Configure Environment Variables

Create a .env file in the root directory with the following content:

LICHESS_API_BASE=https://lichess.org/api/games/user/
LICHESS_USERS=USER1,USER2
EMAIL_FROM=[email protected]
EMAIL_TO=[email protected]
EMAIL_PASSWORD=your-app-password
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
  • Replace [email protected] with the Gmail address used to send notifications.
  • Replace [email protected] with the recipient's email address.
  • Replace your-app-password with the App Password generated for the Gmail account.

3. Install Dependencies

go mod tidy

4. Build and Run the Application

go run .

Usage

  1. The application will start and monitor the Lichess accounts specified in LICHESS_USERS.
  2. When a new game is detected for a user, an email notification will be sent to the recipient specified in EMAIL_TO.
  3. The application will handle errors gracefully and display logs in the terminal.

Features

  • Fetch games from Lichess for multiple users concurrently.
  • Send email notifications for each lost game.
  • Graceful shutdown using OS signals (e.g., CTRL+C).

Example Output

When the application runs:

Starting the Lichess Notifier...
Initializing fetcher for user: praneki_li
Initializing fetcher for user: itsspriyansh
Email sent for game https://lichess.org/game/id
Received signal: interrupt
Shutting down gracefully...
Shutdown complete

About

When a lichess game lost,notify users.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages