Skip to content

metju-ac/train-me-maybe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

train-me-maybe

Train Me Maybe watches occupied RegioJet trains and buses for you. Simply tell it which routes it should watch, and you will get notified once a free seat is found. Even better, it can purchase the ticket for you!

The app is currently in beta version. Only routes without transfers are supported. In case something is not working, definitely let us know at prosim@vyhul.me.

The app was created as a student open-source project during the course PB173 at FI MUNI (Brno, Czech Republic).

Try now at vyhul.me!

Features

Incrementally, we will add these features:

Basic features

  • ✅ (one-shot) based on datetime, ID from and ID to, find the given route and check if there is a free seat
  • ✅ (one-shot) send a notification to an email if there is a free seat
  • ✅ (periodic) watch for the seats with a configurable interval

Automatic purchase

  • ✅ allow the user to enter a regojet login (kreditová jízdenka)
  • ✅ authenticate against the regiojet API
  • ✅ if there is a free seat and the user has enough credit, buy the seat automatically and notify the user

Usability features

  • ✅ notify the user if they have low credit
  • allow the user to put an upper limit on the price of the automatically-purchased ticket
  • notify the user on their Discord channel
  • ✅ allow the user to enter/choose the name of the stations, instead of its IDs (can be some simple terminal UI when starting the app)
  • ✅ allow the user to configure the application via a environment variables and/or configuration file (not only via command line arguments)
  • ✅ allow the user to choose from the seat classes available in the selected train only

Multi-tenancy features

  • ✅ deploy the application to a server
  • ✅ allow the user to configure the application via a web interface
  • ✅ allow multiple users to use the deployed application

Configuration

We support configuration via:

  1. config.toml file
  2. environment variables prefixed with REGIOJET_ - can be loaded from a .env file

The later options have higher priority.

General settings

  • REGIOJET_POLL_INTERVAL - how often to check for the free seats (in seconds). Recommended value is at least 60.
  • REGIOJET_API_BASE_URL - the base URL of the Regiojet API. Default is https://brn-ybus-pubapi.sa.cz/restapi.

Email notifications

We need to know how to connect to an SMTP server to send emails. And also to whom. The following environment variables are used (for example for gmail):

To test that the email notification works for you, you can run

go run .\cmd\email-test\main.go

Automatic purchases

  • REGIOJET_AUTH_CREDIT_USER - the username of your Regiojet account (kreditová jízdenka)
  • REGIOJET_AUTH_CREDIT_PASSWORD - the password of your Regiojet account
  • REGIOJET_AUTH_CREDIT_ENABLED - set to true to enable automatic purchases

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages