Get the Refrigerator Magnets Chumby Widget.
]]>After you load this widget into your Chumby, you must do three things to get it to work:
PHP File
A small php file must be created and posted on your website (this is the file that the widget will get the server uptime from).
Here’s the code:
<?php
if($_REQUEST['pass']==”pass”){
$uptime = explode(” “, @exec(”cat /proc/uptime”));
echo “uptime=”.(int)$uptime[0];
$load = explode(” “, @exec(”cat /proc/loadavg”));
echo “&load0=”.$load[0].”&load1=”.$load[1].”&load2=”.$load[2].”&”;
}
?>
Drop that code into a file (I called mine uptime.php) and place it on your server.
Cross-domain XML File
In order for Flash to access data from a server, a crossdomain.xml file must exist on the top level of your website and must be setup properly. You can read more about it here. Below is the contents of my file which is also available at http://www.ryanc.com/crossdomain.xml
<?xml version=”1.0″?>
<!DOCTYPE cross-domain-policy SYSTEM “http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd”>
<cross-domain-policy>
<allow-access-from domain=”*” />
</cross-domain-policy>
Configure the Widget
When you configure this widget on the Chumby website, enter the full URL to the php file. You’ll also need to enter a password. By default, the password is “pass”, but you can change this on the 2nd line of the php code.
A few notes about this widget…
I’d appreciate your comments & suggestions..
-Ryan
]]>