Skip to content

Script for automated purchase of ZSSK (slovakrail) free ticket(s)

License

Notifications You must be signed in to change notification settings

europ/zssk-ticket-automation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Automated purchase of ZSSK (slovakrail) free ticket(s)

Python script for automated free ticket buying at ikvc.slovakrail.sk/esales/search.

Script will click on buttons and fill up the input boxes for you with the predefined data in person.txt file.

The only thing what you are required to do is to launch the script with exact stations (departure and arrival station), date and time for your train.

Requirements

Python Packages

Installation

Ubuntu/Debian

Ubuntu 16.04.6

  1. Initialize the environment via these commands:
# 1) python3.6 + pip3
sudo add-apt-repository ppa:jonathonf/python-3.6
sudo apt-get update
sudo apt-get install python3.6 python3-pip

# 2) geckodriver
wget --verbose https://github.com/mozilla/geckodriver/releases/download/v0.24.0/geckodriver-v0.24.0-linux64.tar.gz
tar --extract --verbose --gzip --file geckodriver-v0.24.0-linux64.tar.gz
chmod +x --verbose geckodriver
sudo mv --verbose geckodriver /usr/local/bin
rm --verbose --force geckodriver-v0.24.0-linux64.tar.gz

# 3) repository
git clone https://github.com/europ/zssk-ticket-automation.git
cd zssk-ticket-automation

# 4) python packages
python3.6 -m pip install -r requirements.txt

# 5) help test
python3.6 buy.py --help
  1. See Usage section.

Usage

Set up your account credentials in person.txt and launch the script with the correct options (see Options section).

Options

[-h] --departure DEPARTURE --arrival ARRIVAL --time TIME --date DATE [--verbose] [-H | -F]

Order of the options does not matter. Option values must exactly match the train details (time, date and stations). It is recommended to use verbose mode option in case of diagnostics.

Mandatory

  • Departure station -D "Foo" or --departure "Foo"
  • Arrival station -A "Bar" or --arrival "Bar"
  • Departure time -t "HH:MM" or --time "HH:MM"
  • Departure date -d "DD.MM.YYYY" or --date "DD.MM.YYYY"

Optional

  • Help -h or --help
    • show help message and exit
  • Verbose mode -v or --verbose
    • explain what is being done
  • Headless browser mode -H or --headless
    • not allowed with full screen mode
    • web browser without a graphical user interface
  • Full screen browser mode -F --fullscreen
    • not allowed with headless mode
    • web browser in full screen mode

Examples

  • Help

     python3.6 buy -h

    or

    python3.6 buy --help
  • Usage example

     python3.6 buy.py -D "Bratislava hl.st." -A "Kúty" -t "05:16" -d "18.03.2019" -v

    or

    python3.6 buy.py --departure "Bratislava hl.st." --arrival "Kúty" --time "05:16" --date "18.03.2019" --verbose
  • Headless mode example

    python3.6 buy.py -D "Bratislava hl.st." -A "Kúty" -t "05:16" -d "18.03.2019" -H -v

    or

    python3.6 buy.py --departure "Bratislava hl.st." --arrival "Kúty" --time "05:16" --date "18.03.2019" --headless --verbose
  • Full screen mode example

    python3.6 buy.py -D "Bratislava hl.st." -A "Kúty" -t "05:16" -d "18.03.2019" -F -v

    or

    python3.6 buy.py --departure "Bratislava hl.st." --arrival "Kúty" --time "05:16" --date "18.03.2019" --fullscreen --verbose

Log

log-example

Help

If you have purchased a wrong ticket you are able to cancel it here.

In case of any problem, please feel free to open an issue and specify the problem with detailed description.

Contributing

Feel free to contribute via opening a pull request or an issue.

License

This project is available as open source under the terms of the MIT License.

Releases

No releases published

Packages

No packages published

Languages