Script that monitors Ukrainian Railroad (Укрзалізниця) booking site (https://booking.uz.gov.ua) and sends email notification when desired tickets are available.
File settints.json
contains application settings:
{
"email":{
"server":"smtp.example.org:port",
"username":"[email protected]",
"password":"secretpassword"
}
}
File monitors.json
contains a list of objects. Each object specifies departure station,
departure date, and destination station. Every time the script is executed, it iterates over
all of this objects and checks if tickets with specified parameters have became available.
[{
"departure_date":"2015.4.2",
"departure_station":"Київ",
"destination_station":"Івано-Франківськ",
"classes":[3],
"email":"[email protected]"
}]
classes
field is a list and specifies seats classes which should be monitored
i.e. 1
represents the first class.
email
in an address which is used to send notifications.
In order to run script, proper sqlite3 database should be created:
$ sqlite3 db.sqlite3 < createdb.sql
$ python3 ticketcheck.py