[JDEV] Listing Users who are Connected to the Server

Ralph Siemsen ralphs at blueairnetworks.com
Tue Apr 15 12:23:48 CDT 2003


Jerry McMorran wrote:

> I have read this thread which contain similar things I want:
> news://news.gmane.org/3E2E8E30.DF3AF14D@terravirtual.net
> But I cannot find the answer for displaying online users' JIDs.

Well you can get the names of the online users with the script that I
posted in that thread.  The script is in perl, you could write it in PHP
if you wanted, or just call it from cron every minute and let it write
to a filename of you choice.

http://mailman.jabber.org/pipermail/jdev/2003-January/014678.html

For each user this will give you an XML chunk like so:

<presence from='JID at SERVER.COM/RESOURCE'>
   <priority>5</priority>
   <show>chat</show>
   <status>Online</status>
   <x xmlns='jabber:x:delay' stamp='20030415T16:25:57'
      from='JID at SERVER.COM/RESOURCE'/>
   <x xmlns='jabber:mod_admin:who' timer='7944' from='580'
       to='490'/>
</presence>

You can parse these chunks easily enough, either using regular
expressions, or if you wish, a full XML parser.

-R




More information about the JDev mailing list