View/Edit #330!igoogle

File name: igoogle
<?xml version="1.0" encoding="UTF-8" ?> 
<Module>
  <ModulePrefs title="Who's on Moo Canada"> 
    <Require feature="dynamic-height"/>
  </ModulePrefs>
  <Content type="html">
  <![CDATA[
    <SMALL>
    <A HREF='http://www.moo.ca/'>Moo Canada</A> players currently online:
    <div id="content_div">Loading...</div>
    </SMALL>
    <script type="text/javascript">
      _IG_FetchXmlContent("http://www.moo.ca/who/rss", buildList, { refreshInterval: (60 * 5) });

      function buildList (response) {
        if (response == null || typeof response != "object" || response.firstChild == null) {
          _gel("content_div").innerHTML = "<i>Invalid data.</i>";
          return;
        }

        var html;
        // Get a list of the <PLAYER> element nodes in the feed
        var playerList = response.getElementsByTagName("PLAYER");
        if (playerList[0]) {
          html = '<BR><TABLE CELLSPACING=1 CELLPADDING=1><TR><TH BGCOLOR="#dddddd"><SMALL>Name</SMALL></TH><TH BGCOLOR="#dddddd"><SMALL>Conn</SMALL></TH><TH BGCOLOR="#dddddd"><SMALL>Idle</SMALL></TH></TR>\n';
          for (var x = 0, player; player = playerList[x]; x++) {
            var name = player.getAttribute("NAME");
            var url = player.getAttribute("URL");
            var conns = parseInt(player.getAttribute("CONNECTED"), 10);
            var connm = Math.floor(conns / 60);
            var connh = Math.floor(conns / 3600);
            var conn = connh ? (connh + 'h') : (connm ? (connm + 'm') : (conns + 's'));
            var idles = parseInt(player.getAttribute("IDLE"), 10);
            var idlem = Math.floor(idles / 60);
            var idleh = Math.floor(idles / 3600);
            var idle = idleh ? (idleh + 'h') : (idlem ? (idlem + 'm') : (idles + 's'));
            html += '<TR><TD BGCOLOR="#eeeeee"><SMALL><A HREF="' + url + '">' + name + '</A></SMALL></TD><TD BGCOLOR="#eeeeee" ALIGN=right><SMALL>' + conn + '</SMALL></TD><TD BGCOLOR="#eeeeee" ALIGN=right><SMALL>' + idle + '</SMALL></TD></TR>\n';
          }
          html += '</TABLE>';
        } else {
          html = "<P><CENTER><I>I don't see anyone online.</I></CENTER>"; 
        }

        _gel('content_div').innerHTML = html;

        // Tells gadget to resize itself
        _IG_AdjustIFrameHeight();
      }
    </script>
  ]]>
  </Content>
</Module>

http://files.moo.ca:8081/3/3/0/igoogle
Size: 2,321 bytes.
File perms: Readable


You are not logged in.

[home | help | who | search | setup | code]