Thread: Staff Activity
View Single Post
  #8  
Old 09-13-2012, 11:53 PM
BlueMelon BlueMelon is offline
asdfg
BlueMelon's Avatar
Join Date: Sep 2008
Posts: 1,481
BlueMelon is a splendid one to beholdBlueMelon is a splendid one to beholdBlueMelon is a splendid one to beholdBlueMelon is a splendid one to behold
Whiped up a little python script:

PHP Code:

#Copy/Paste your staff= into this string here:
server_staff "MonkeyBob,BlueMelon,Crow,Stefan"


months = ['Jan','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec']
open("rclog.txt",'r')
log f.readlines()
f.close()
staff server_staff.split(",")
times = {}
for 
s in staff:
    
times[s] = 'Jan 01'

for i in range(0,len(log)):
    if (
i+1) >= len(log):
        break
    
line log[i]
    
line2 log[i+1]
    if 
"is logged in from" in line2 and "Client-RC" not in line2:
        
acc line2.split(" ")[0]
        if 
acc in staff:
            
currentmonth times[acc].split(" ")[0]
            
currentmonth_num months.index(currentmonth)
            
newmonth line.split(" ")[2]
            
newmonth_num months.index(newmonth)
            if 
newmonth_num >= currentmonth_num:
                
times[acc] = line[10:len(line2)-1]


for 
acc in times.keys():
    print 
"Last Login ("+acc+"): "+str(times[acc]) 
http://pastebin.com/5yVy0e7w


Output:
PHP Code:
Last Login (BlueMelon): Sep 13 23:11:23 2012

Last Login 
(MonkeyBob): Sep 13 15:31:56 2012

Last Login 
(Stefan): Jul 18 03:36:44 2012

Last Login 
(Crow): Sep 13 17:12:31 2012 
__________________
http://i.imgur.com/OOJbW.jpg

Last edited by BlueMelon; 09-14-2012 at 10:10 PM..
Reply With Quote