Generating your own CML

It's easy to create your own CML files, save them on a web server and assign them to a screen. But don't forget that they can be dynamically generated by a piece of software.

Here, for example, is a simple PHP script which you can put on a Linux-based web server and it will show you the current load on that server. Create a new CML page on CODA, specifying the location of the PHP file as the URL, and you can assign it to a screen.

It should produce something like this:

If you just assign a CML page directly to a display it will update every 5 mins or so. For tighter control of the timing, add it to an album.

Here's the PHP:

<coda version="0.1">
<div background="black">

<div height="100" background="#408060">
  <p align="center"><big>Server <?php echo `hostname` ?></big></p>
</div>

<div ypos="30%">
  <p align="center">The current load on this server is <br />
  <span size="60000" color="yellow">
  <?php 
    $load = file_get_contents("/proc/loadavg");
    $loadbits = explode(' ', $load);
    echo $loadbits[0];
  ?>
  </span>
  </p>
</div>

<div ypos="-140">
  <p align="right"><?php echo date("D j M H:i T") ?></p>
</div>

</div>
</coda>