This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Uptime (how much a user is online) script

Old posts that have not been replied to for several years.
Locked
c
cerberus_gr
Halfop
Posts: 97
Joined: Fri Feb 07, 2003 8:57 am
Location: 127.0.0.1

Uptime (how much a user is online) script

Post by cerberus_gr »

Hello,

I want to write a script which takes a log file and returns the uptime of some users.
This I want is help about the idea.

I have thought to save all chan users at 00:00 and then the next day on 00:00 to parse the channel log. How to parse it and extract the info I want? What about netsplits?

thx :)
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

you need to remote WHOIS the users and then parse numeric 317 (signon time) reply
c
cerberus_gr
Halfop
Posts: 97
Joined: Fri Feb 07, 2003 8:57 am
Location: 127.0.0.1

Post by cerberus_gr »

I think that this is too complicated. Why not to parse the logs?
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

*shrug*

searching through logs won't give you person's signon time (that's when he or she has connected to IRC), hence no uptime for you buddy

and no, obtaining the real signon time (and calculating uptime from it) via WHOIS is not complicated at all
c
cerberus_gr
Halfop
Posts: 97
Joined: Fri Feb 07, 2003 8:57 am
Location: 127.0.0.1

Post by cerberus_gr »

Sorry then, because I didn't explain well what i want to do.

This I want is to save the uptime for each user for every day (24 hours).
First of all i want to calculate the uptime of my eggdrop and after the uptime of the other users. And all of these for a day. Every night at 00:00 I just have to parse the logs and create a xml file for the previous day...

So even if the user was online for 20 hours (from 00:00 until 20:00) and he closed his client at 20:01 and returned to irc at 21:00, i want to have save the 20 hours that he was online.
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

heh, well, now that is complicated

you need to sum up all user appearences on the channel by parsing logs, or better yet (and much less complicated) by tracking user's presence on channel with a time counter (start counting when he/she joins, stop counting on quit, part, kick)
c
cerberus_gr
Halfop
Posts: 97
Joined: Fri Feb 07, 2003 8:57 am
Location: 127.0.0.1

Post by cerberus_gr »

Does anybody has any code which does the same?

Thx
e
egghead
Master
Posts: 481
Joined: Mon Oct 29, 2001 8:00 pm
Contact:

Post by egghead »

cerberus_gr wrote:Does anybody has any code which does the same?

Thx
Hi, some time ago I wrote an onlinetime.tcl. It sends an whois to the server and parses the raw 317. This is what demond suggested.

Not sure if the method proposed by cerberus does really provide the correct info.

http://members.fortunecity.com/eggheadtcl then onlinetime.tcl (direct linking is not allowed with fortunecity. How unfortunate.)
c
cerberus_gr
Halfop
Posts: 97
Joined: Fri Feb 07, 2003 8:57 am
Location: 127.0.0.1

Post by cerberus_gr »

thx a lot :)
Locked