GeekShed now provides a live XML formatted output of users in your channel. This can be parsed and placed on your own website in the form of a list, table, etc.

The XML output can be found at http://www.geekshed.net/usertable.php?chan=. An example of the use of this for #phil is http://www.geekshed.net/usertable.php?chan=phil. To parse this into a table on your website, you can use the following PHP code. All you need do is place the code at the required location on the page and adjust the channel name at the top of the code. Following this, you can adjust the HTML to fit your site’s requirements.

<?php
// Edit This
$chan = 'phil';

// Don't edit this
$xml = simplexml_load_file('http://www.geekshed.net/usertable.php?chan='.$chan);
?>

<!-- Edit this HTML to suit your layout -->

<table>
   <tr>
      <td style="text-align: center;"><strong>Nickname</strong></td>
      <td style="text-align: center;"><strong>Status</strong></td>
      <td style="text-align: center;"><strong>Clones</strong></td>
      <td style="text-align: center;"><strong>Active (Not Away)</strong></td>
   </tr>

<?php
foreach ($xml->user as $user) {
   echo "\t<tr>\n";
   echo "\t\t<td style=\"text-align: center;\">{$user->nick}</td>\n";
   echo "\t\t<td style=\"text-align: center;\">{$user->status}</td>\n";
   echo "\t\t<td style=\"text-align: center;\">{$user->clones}</td>\n";
   echo "\t\t<td style=\"text-align: center;\">{$user->away}</td>\n";
   echo "\t</tr>\n";
}
?>
</table>


You can also access the away message left by a user who is away using $user->awaymsg inside the foreach loop.

The DTD for the XML can be found at http://www.geekshed.net/xml/userlist.dtd.

As at 08 April 2010 the returned XML now has double escaped entities (e.g. < goes to &lt; and ASCII char 2 goes to &#002;). SimpleXML in the above example will do a single unescape on these such that &lt; goes to < such that it can be used in web pages whilst keeping them valid. If you use it for anything else you will need to be sure to unescape sufficiently to give you the original characters.

If you have any questions about this, ask in #help.