mIRC Home    About    Download    Register    News    Help

Print Thread
Script to see the amount on online users on a site #203481 17/08/08 08:08 AM
Joined: Aug 2008
Posts: 1
K
kurtie Offline OP
Mostly harmless
OP Offline
Mostly harmless
K
Joined: Aug 2008
Posts: 1
Hello everyone smile

I'm looking for a script which allows me to post a link on my websites to the chat, but I want to include after that link the amount of online users.

For example: chatlink (12 online)

Can someone help me please?

Re: Script to see the amount on online users on a site [Re: kurtie] #203501 17/08/08 08:58 PM
Joined: Dec 2002
Posts: 155
S
Strider Offline
Vogon poet
Offline
Vogon poet
S
Joined: Dec 2002
Posts: 155
I don't know the setup of your HTTP server and which scripting language you're using, but here are some ideas:

If your computer is the HTTP server, then a simple solution would be writing (and updating periodically) a file to a path reachable by the scripting language (PHP, for example) and then reading the file and creating the markup for the link each time a user requests the page where you want to show it.

If the HTTP server is somewhere else, then you could create a "secret" page that receives a query string or POST parameter and then uses it to update either a file or a value in an SQL database. All you would need to do is to access this page with mIRC periodically while sending the number of users as the parameter. Then you would have to read the file or database value to create the markup for the link each time a user requests the page where you want to show it.

These solutions are mIRC-based, but the optimal one would be not using mIRC at all, but an independent process that updates the value.

Last edited by Strider; 17/08/08 09:00 PM.
Re: Script to see the amount on online users on a site [Re: kurtie] #203511 18/08/08 06:47 AM
Joined: Jul 2003
Posts: 46
V
vexx0r Offline
Ameglian cow
Offline
Ameglian cow
V
Joined: Jul 2003
Posts: 46
What kind of chat software are you using? If you are using chatspace it has a built in feature to grab the users in a specific chat room by calling a variable I.E. %USERS%. Otherwise I would perform a custom /who and count the different idents or rooms chatters are in and inc them accordingly. For instance you could type /who chatlinks in which case your custom /who script would count the users in chatlinks and display a total. Then you could sock write that to a file every so often. I have done this both ways and if you are using chatspace it is much easier. Yet not impossible the other way. Also, You could program a php bot to connect to the server and join the room, that would get an accurate count every time someone viewd the page. though it wouldn't have an automatic refresh without javascript or ajax or something similar. Good luck.