Monitor MTS-K connected websites for fuel price changes and notify users on change
PHP HTML
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src/FuelMonitor
test/FuelMonitor
.gitignore
Envoy.blade.php
LICENSE
README.md
composer.json
composer.lock
ct_getPrices.php
example_preferences-ct.json
example_preferences-tk.json
example_preferences-tt.json
example_preferences-vt.json
example_users.json
phpunit.xml
tk_getPrices.php
tt_getPrices.php
vt_getPrices.php

README.md

fuelmonitor

Monitor MTS-K connected websites for fuel price changes and notify users on change in reference to a "home" station

The following sources for data are supported:

#Usage example_preferences-<xy>.json are example configuration files with idMapping for stations to monitor and home station (id prefixed by underscore)

Notification of users happens via Pushover.net => Configure group or user keys in users.json (see example_users.json)

<xy>_getPrices.php is the trigger script for the corresponding service. Run this via cronjob every few minutes (MTS-K backend of the services updates every 5 minutes, so shorter intervals make no sense)

Extend

If you'd like to add another service to monitor, just extend the FuelMonitor class and implement the fetchPrices method. The method should return boolean value indicating success or failure and set the newPrices and comparePrices objects. It should furthermore call the findCheapest method with the fuelName as sole parameter for each fueltype and assign the returned value to the minPrices[$fuelname] property.

#Logging FuelMonitor base class initiates a MonoLog logger that catches all Exceptions and PHP errors. By default it is configured to log to a Sentry instance via the Raven handler. Feel free to add your own logging handler instead