Giter VIP home page Giter VIP logo

londonbus's Introduction

London Buses

I once attempted to create the first real time London bus map using the TFL prediction API. There are a couple of scripts in here that are kind of useful.

This is a bit of a dump of code I didn't want to lose but can't entirely remember what it does! Roughly putting it back together below. You will need python to run the scripts that scrape the APIs, the predictionScraper should run indefinetly constantly updating mongoDB with new predictions. At some point locaitons were being placed in redis before being broadcast for the frontend app to pick up - i'm not sure if this still exits.

This is all super hacky, good luck if you continue. Do as you wish with anything in this repo.

buses/worker/stopScraper.py This scrapes an undocumented API used by TFLs live maps (might not work anymore!) and identifies all stops in the TFL network and works out the routes they are on. It will store all routes and their stops in mongoDB.

buses/worker/predictionScraper.py Runs through the TFL bus arrival prediction api

buses/node/locator.js Somewhere within this is some logic which finds a bus, works out where it was last seen and where it is due to arrive next. Based on the time difference it will plot the buses estimated location between those 2 points on a route and then render that on a google map. It will broadcast bus points via socket io which can be picked up by the frontend app.

buses/worker.py A refactor of the scrapers above which run indefintly updating mongodb with real time data.

map/ Contains the code that renders the map

londonbus's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.