Many Pies

Many Pies

Tuesday, November 26, 2013

New office - furniture and rolling display


There's a good post with lots of pictures of our new office on the Wycliffe Centre move blog. I've been involved in the office layout planning since near the start of the process and one of the things we needed to consider was which office furniture to get. Because our previous furniture was from all sort of different sources it was very mismatched, so we wanted to spend money on getting new desks. (We managed to reuse a number of other bits of furniture, such as non-desk chairs, bookcases and some cabinets.) In the end we went with furniture company called Ofquest. Even with a generous discount it wasn't cheap. What we got for our money though was solid construction, a degree of reconfigurability, and really useful features, like a cable tray under the desk and clip on cable guides for the legs. It should last us a number of years, and survive another office move should we move before it wears out.

One of things of lesser importance that I've worked on with Ruth, our content person, and Stuart and Andy, my IT colleagues, is the TV display you can see above. Stuart and Andy got a Raspberry Pi going booting into the Chrome browser and displaying a page from our intranet. The page changes every few seconds and as well as showing prayer items shows things to praise God for, internal notices, the picture of the week from wycliffe.net. For that page, and another one which screenscraped our own wycliffe.org.uk site I used a bit of  XPath, obtained via Chrome's web inspectory thingy, which makes it very easy to get at HTML content. Here's a fragment of the code I used:

$pageHTML = file_get_contents($url);
if ($pageHTML) {
$dom = new DomDocument();

$dom->loadHTML($pageHTML);
$xpath = new DOMXPath($dom);
$entries = $xpath->query('//*[@id="image"]/img');

if ($entries) {
$tag1HTML = nodeContent($entries->item(0), true);
}
}

The user-editable pages were done with Perch, a very neat content management system. It's not suitable for large sites, probably defined by complexity of navigation rather than number of pages. It's very quick to get going on though. I used the API to write a custom app which removed items from a page when an associated expiry date had passed. As you've got access to the source code as well as the API documentation I was able to write something which delved into the Perch innards without too much effort, once I understood factory classes. When I needed support I got a quick response (_/- confusion - doh!).

No comments: