I put this together for use on an enjin.com-hosted site, but it should work on anything you can place the HTML in, so long as you have a jQuery version loaded already.
Note the YOUR_OUTFIT_ID_HERE that you need to edit in the query.
Also the CSS will need tweaking for your own use, as I borrow various bits of the enjin theme we use.
It auto-refreshes every 5 minutes, or there's a Refresh button you can use.
Code:
<div id="ps2-ingame">
<div class="element_smalltitle">
<div class="left"><!-- --></div>
<div class="right"><!-- --></div>
<div id="in-game-members-header" class="title">In-Game Currently:</div>
</div>
<div id="in-game-members" class="m_shoutbox" style="height: 150px; overflow-y: scroll;"></div>
<div id="ps2-ingame-as-of" style="text-align: center"></div>
<div style="text-align: center;">
<div class="element_smallbutton">
<div class="l"><!-- --></div>
<div class="r"><!-- --></div>
<input id="ps2-ingame-refresh" type="button" value="Refresh">
</div>
</div>
</div>
<script type="text/javascript">
var refreshTimer = null;
window.jQuery(document).ready(function($) {
$('#ps2-ingame-refresh').click(refreshIngameStatus);
doIngameStatus();
});
function doIngameStatus() {
$.ajax({
url: 'http://census.soe.com/s:miggyorg/get/ps2-beta/outfit/YOUR_OUTFIT_ID_HERE/?c:resolve=member,member_online_status,member_character%28name%29',
type: 'GET',
timeout: 20000,
dataType: 'jsonp',
success: onMembersReceived,
complete: onMembersComplete
});
}
function onMembersReceived(json) {
var now = new Date();
var ingame_members = countOnlineMembers(json.outfit_list[0]);
$('#in-game-members-header').html('In-Game Currently (' + ingame_members.length + '):');
$('#in-game-members').html('');
for (var x = 0 ; x < ingame_members.length ; x++) {
$('#in-game-members').append('<div class="shout">' + ingame_members[x] + '</div>');
}
$('#ps2-ingame-as-of').html('<div class="shout">As of: ' + now.toTimeString() + '</div>');
}
function countOnlineMembers(outfit_list) {
var ingame = new Array();
for (var m = 0 ; m < outfit_list.members.length ; m++) {
if (outfit_list.members[m].online_status > 0) {
ingame.push(outfit_list.members[m].name.first);
}
}
ingame.sort(caseiCompare);
return ingame;
}
function caseiCompare(a, b) {
var ai = a.toLowerCase();
var bi = b.toLowerCase();
if (ai > bi) {
return 1;
} else if (ai < bi) {
return -1;
} else {
return 0;
}
}
function refreshIngameStatus() {
refreshTimer = null;
doIngameStatus();
}
function onMembersComplete(jqQuery, jqStatus) {
refreshTimer = setTimeout(refreshIngameStatus, 5 * 60 * 1000);
}
</script>