DVSA Test Cancellation Checker
This is a small PHP application designed to send notifications when cancellations become available for a practical driving test scheduled with the UK DVSA.
Table of Contents
To run the application, you will need:
- A server with PHP installed (ideally Linux)
- The PHP
curlmodule - this is used to make requests to the DVSA website
- A booked driving test, complete with application reference number (found on your test confirmation email)
This application has been tested with PHP 5.4, 5.5, 5.6 and 7.0, as well as HHVM and Nightly PHP builds, via TravisCI.
To get started, all you need to do is copy/rename
secrets.php and fill in your data. For example:
$check_data = array ( 'craig' => array ( 'licence_number' => 'SMITH27712AE1OW', 'application_id' => '1233493', 'latest_date' => '2016-07-26', 'earliest_date' => '2016-06-18', 'ideal_day' => 'Friday', 'email_to' => 'email@example.com', ) );
You can optionally configure the address that the script uses to send email, and also an HTTP proxy with optional authentication.
DVSA Site Changes
From time-to-time, the DVSA may make changes to their website which may break the script. As I have now passed my practical test, I'm not able to continually test if the script is working.
If you encounter an issue with the script, you are welcome to test it using your own license number and application reference and submit a pull request with your changes.
Email SMTP settings
Also note that sending email via external SMTP servers is currently not
possible, all email is sent via PHP's internal
Scheduled Job via Cron
To check for cancellations regularly, you can use the Linux cron utility. The below example will run the script every fifteen minutes, between the hours of 7am and 11pm - the DVSA website is taken offline outside of these hours.
The below assumes that the application is installed in
*/15 7-23 * * * /usr/bin/php /opt/dvsa-test-check/test_check.php >> /var/tmp/test_check.log 2>&1
Checking for Changes in License Status
Once you have taken your test and (hopefully) passed it, you can use the
license_check.php script to check when your license has changed from a
provisional to a full license.
The script will email you with any changes to your license data, including your issue number, valid from, valid to and license status.
The data format in
secrets.php follows the same format, with the addition of
your National Insurance number and post code.
Contributions and testing reports are extremely welcome. Please submit a pull request or issue on GitHub, and make sure that your code conforms to the PEAR PHP coding standards (Travis CI will test your pull request when it's sent).
I accept tips via Bitcoin to 1BympojWkXErUpEVE6HXm3vWNj9W6wVP2Z - if you would like to buy me a beer or a coffee, please do!