Schedule viewer for the Barcelona subway.
- Clone this repository (usually in Apache's publicly accessible folder).
- Install PHP 7.2+ with the
ZipArchiveandPDOclasses (specifically install thePDO_SQLITEdriver) - Copy the
config.default.phpfile toconfig.phpand fill in the details (you can get an API key directly from TMB here.- In
$conf["databaseFile"]enter the absolute path of the location where you want to save your database (including the file name). If the website is located in the/var/www/html/schedules/folder, you can create a newfilesfolder there and set the variable to/var/www/html/schedules/files/gtfs.sqlite3.
- In
- Run the
cron/parsegtfs.phpscript regularly to get updated information (e.g. once a week).
- As I've been able to see when using this app around Barcelona, the schedules provided by TMB are a very vague approximation of the departure times for all lines except for the automated lines. In the case of the automated lines, the timing is precise within a second.