One of the awesome products we’ve built at EndGame is ArthurMP — a platform for controlling digital signage.
Its goal is to make managing signage assets as easy as possible. Along with expanding the range of available asset types — from the static videos and pictures we see today to more dynamic assets which are fed from data sources.
As a result, we have a lot of screens in the office! One of which is dedicated to dogfooding these assets with team-related info. One of my favourites shows the current releases for the month done by our Octopus Deploy server.
Octopus has a very rich api that lets you get all the information out, which is a great starting point.
ArthurMP has the concept of a JSON data feed asset. This JSON data feed polls a URL and stores the result to be pushed to screens, along with the other parts of the asset.
The current version of this does not allow for custom headers, which makes authenticating against octopus a no go (I’m not so keen on passing the api key on the query string). Instead, I roll a simple hapi server to act as a proxy between ArthurMP and Octopus, and host it in Azure.
This creates a simple data feed of JSON as seen below:
{
"live" : 1,
"peek" : 9,
"stage" : 26
}
Firstly, create a simple HTML / CSS / Image bundle that displays numbers. The data feed is consumed in the HTML as shown in this snippet:
window.run = function (dmc) {
var feed = JSON.parse(dmc.getFeedContent('deploys')[0].Json);
document.getElementById("stage").innerHTML = feed.stage;
document.getElementById("peek").innerHTML = feed.peek;
document.getElementById("live").innerHTML = feed.live;
};
This is then uploaded into ArthurMP as an asset.
Secondly, set up a data feed that is polling the hapi server on a regular basis (in this case every 5 minutes).
The finishing touch is to publish the asset to the screen, and bask in the glory of your information radiation.