Re: WWW statistics using python (2/3)

Paul Sijben (sijben@cs.utwente.nl)
Fri, 1 Jul 1994 14:18:06 GMT

oops, I just noticed a small bug......

conversion of the ascii representation of a date in to seperate fields using
splitfields gives trouble when the day is <10. So a few updates:

In article <Cs9AzA.Jt3@cs.utwente.nl>, sijben@cs.utwente.nl (Paul Sijben) writes:

|> def readandcheck(fd,regels,dayrange,monthrange):
|> while 1:
|> regel=fd.readline()
|> if len(regel)<1:
|> break
|> else:
|> tmp=splitfields(regel," ")
dag=tmp[3]
if dag=="":
dag=tmp[4]
if tmp[2] in monthrange and dag in dayrange:
|> regels.append(tmp)

|> def NewWWWpage(aantallen,fromlist ,dayrange,monthrange,year):
|> names=['Refdbms service', 'PGP docuentation', \
|> 'Campus information pages', 'Weather images',\
|> 'Badge system', 'Fingers on persons directly',\
|> 'Private pages of people', 'Others']

O, yes, Mind this part when changing the services variable

|> def aggregate(tolist,fromlist,aantallen,regels):
|> for i in range(len(regels)):
|> tmp=regels[i]
|> van=tmp[0]
|> if len(splitfields(van,'.'))>2 and van[0] in letters:
|> van=van[index(van,'.')+1:]
|> if fromlist.has_key(van)==0:
|> fromlist[van]=([0,0,0,0,0,0,0,0,0,0,0])

change this one too when changing the number of services

|> page=tmp[7]
change into
page=tmp[-2]

|> if tolist.has_key(page):
|> tolist[page]=tolist[page]+1
|> else:
|> tolist[page]=1
|> for j in range(10):
|> if find(page,sservices[j])!=-1:
|> if j==7:
|> k=6
|> else:
|> k=j
|> break
|> else:
|> k=7

The assignments above map ~ onto people

|> aantallen[k]=aantallen[k]+1
|> fromlist[van][k]=fromlist[van][k]+1
|> fromlist[van][-1]=fromlist[van][-1]+1
|>
|> def main():
|> dayrange=[]
|> monthrange=[]
|> year=parsecommandline(dayrange,monthrange)
|> regels=[]
|> readinput(regels,dayrange,monthrange)
|> fromlist={}
|> tolist={}
|> aantallen=[0,0,0,0,0,0,0,0,0,0]

change this one too when changing the number of services

That's all for now.
I defenitely am in need of a holliday. An that is exactly what I am going to
do.

Paul

_______________
Paul Sijben tel.: +31-53-893735 | Zooropa... don't worry baby
University of Twente computer science dep.| It's gonna be alright
e-mail: sijben@pegasus.esprit.ec.org | Zooropa... uncertainty...
For PGP key finger my e-mail address | can be a guiding light