Platform 5 to nowhere fast. Gordon monitors National Rail delays and reports them on Twitter.
- Twitter API keys, these can be obtained from Application Management.
- Transport API keys, these can be obtained from the Developer Console.
Add a file in config/config.json with the following format:
{
"poller": {
"duration": 60000
},
"stations": [
"BTN",
"CLJ"
],
"operators": {
"TL": "@TLRailUK",
"SN": "@SouthernRailUK",
"SW": "@SW_Trains",
"GX": "@GatwickExpress",
"SE": "@Se_Railway",
"LO": "@LDNOverground",
"DEFAULT": "@nationalrailenq"
},
"tags": [
"#AllChange",
"#DelayRepay",
"#RailRefunds"
],
"transport": {
"url": "https://transportapi.com/v3/",
"app_id": "xxxx",
"app_key": "xxxx"
},
"twitter": {
"consumer_key": "xxxx",
"consumer_secret": "xxxx",
"access_token_key": "xxxx",
"access_token_secret": "xxxxx"
},
"redis": {
"host": "redis",
"port": 6379
}
}For ease and portability, Gordon uses Docker. To get set up, simply run:
docker-compose build
docker-compose upNote that this will use Dockerfile-dev rather than Dockerfile, which is intended only for production.
Gordon is set up to be deployed on a device such as a Raspberry Pi using Resin OS. Before deploying, ensure the image in the Dockerfile is correctly selected for
your chosen architecture. Some images can be found on Docker Hub.
To get Gordon up and running:
-
First, you'll need the Resin Device Toolbox installed and your device set up with Resin OS.
-
Gordon uses Redis for its queue and database. To get that running, you'll need to pull and start the redis docker image for your architecture. Links to official docker images for various architectures can be found here.
rdt ssh docker pull armel/redis docker run -d --name redis -p 6379:6379 armel/redis
-
Ensure
redis.hostis correctly set tolocalhostinconfig/config.json. You can then run the following to deploy:rdt push resin -s .
