Skip to content

Example Applications

David Somers edited this page Jun 23, 2016 · 7 revisions

This is a list of applications using Huxley and some extra example code.

Python

JavaScript

  • InstaBail: An app to help you instantly bail on your mates.

  • Example code (paste this into your web console F12):

var r = new XMLHttpRequest();
r.open("GET", "https://huxley.apphb.com/all/stp/from/bxs/1?accessToken=DA1C7740-9DA0-11E4-80E6-A920340000B1", true);
r.onreadystatechange = function () {
    if (r.readyState != 4 || r.status != 200) return;
    var resp = JSON.parse(r.response);
    if (resp.trainServices && resp.trainServices.length > 0) {
        alert("The next train to arrive at " + resp.locationName + " from " + resp.filterLocationName + " will get in at " + resp.trainServices[0].sta);
    } else {
        alert("Sorry, no trains from " + resp.filterLocationName + " arriving soon");
    }
};
r.send();

Pebble

Ruby (on Rails)

Clone this wiki locally