Skip to content

Gordon is always on hand to make sure National Rail delays never go unnoticed.

Notifications You must be signed in to change notification settings

DCRichards/gordon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@DCRichards/gordon

Platform 5 to nowhere fast. Gordon monitors National Rail delays and reports them on Twitter.

gordon

Prerequisites

Configuration

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
  }
}

Setup

For ease and portability, Gordon uses Docker. To get set up, simply run:

docker-compose build
docker-compose up

Note that this will use Dockerfile-dev rather than Dockerfile, which is intended only for production.

Deployment

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:

  1. First, you'll need the Resin Device Toolbox installed and your device set up with Resin OS.

  2. 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
  3. Ensure redis.host is correctly set to localhost in config/config.json. You can then run the following to deploy:

    rdt push resin -s .

About

Gordon is always on hand to make sure National Rail delays never go unnoticed.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published