WebStats script for dch++

Releases and bugs in here...
qqzm
Posts: 47
Joined: 2003-01-23 12:08

WebStats script for dch++

Post by qqzm » 2003-06-23 14:49

Gadget's WebStats script for nmdch ported to dch++ by me. With a few small changes.

You can get it here:
http://members.lycos.co.uk/qqzm/dchpp/

And see some sample output here:

http://members.lycos.co.uk/qqzm/tveps/

BSOD2600
Forum Moderator
Posts: 503
Joined: 2003-01-27 23:47
Location: USA

Post by BSOD2600 » 2003-06-24 00:28

Looks cool, but ftp upload doesnt seem to work nor can I see my local stat file thats generated. Here is what ftplog.txt has:

Code: Select all

ftp> ftp> open upload.attbi.com
Invalid command.

ftp> username
Invalid command.

ftp> password
Not connected.

ftp> ascii
Not connected.

ftp> put "stats.htm" "stats.html"
quit

qqzm
Posts: 47
Joined: 2003-01-23 12:08

Post by qqzm » 2003-06-24 08:23

Hmmm, not sure why ftp uploading isn't working for you, I have no problem with it. As for not seeing the local file, if you have ftp upload turned on the local file is deleted after being uploaded. Try switching ftp upload off and see if the file is created ok. If so it may be a problem with your ftp settings.

yakko
Posts: 258
Joined: 2003-01-27 06:04

Post by yakko » 2003-06-24 12:47

can you give a little documentation on how to set this up? I've fould Gadget's site, does the config work exactly the same?

qqzm
Posts: 47
Joined: 2003-01-23 12:08

Post by qqzm » 2003-06-24 13:29

Yeah, I guess some docs would be helpful. I was being a tad lazy. :D
Ok, quick set-up guide...

1) Copy WebStats.lua and template.htm to you dchpp\Scripts directory.
2) Edit your LuaScripts.xml file to include WebStats.lua.
3) Copy the images1 directory to your web server directory or upload to your ftp site.
4) Edit the config section of your WebStats.lua file (explained below) to suit your setup.
5) Reload your lua scripts and all should be working fine.



Config Section: (I've uploaded a new version which groups all the settings together at the top. In the original this was split up a bit.)

Code: Select all

-- ==============================
-- User Settings.
-- ==============================

iUpdateInterval   = 600
     Time in seconds between each update.

iChatLines   = 25
     Number of lines of chat to show.

sTemplateFile   = "Scripts/template.htm"
     Path (relative to the root of dchpp) to your template file. (You shouldn't need to change this)

sOutputFile   = "index.htm"
     The path to output the stats html file to. Note: If using ftp upload this file will be removed after being uploaded).

sSettingsFile   = "Scripts/StatSettings.txt"
     Path to the file where the script stores its settings. (You shouldn't need to change this)

sRulesFile   = "texts/rules"
     Path to the file containing your hub rules.


bUseFtp      = 0
     Set to 1 to use ftp upload, 0 otherwise.

sFtpBatchFile   = "Ftp.scp"
     (You shouldn't need to change this)

sFtpLogFile   = "Scripts/FtpLog.txt"
     Path to the ftp log file.

sFtpAddress   = "myftpsite.com"
     Address of your ftp server.

sFtpFilename   = "index.html"
     Remote filename for the stats file.

sFtpUsername   = "username"
sFtpPassword   = "password"
     Your ftp login details.


BSOD2600
Forum Moderator
Posts: 503
Joined: 2003-01-27 23:47
Location: USA

Post by BSOD2600 » 2003-06-24 18:10

Well after I started to look into why ftp wasnt working, I realized the hub the computer was running on, couldnt even talk to my ftp site for whatever odd reason. Anyways, now I got it working...

http://bsod2600.home.attbi.com/stats.htm

qqzm
Posts: 47
Joined: 2003-01-23 12:08

Post by qqzm » 2003-06-24 19:34

BSOD2600 wrote: Anyways, now I got it working...


Sweet. :D

However, looking at your page it seems there's some wierd bug with the downtime (yours is reporting over a year of downtime)... I'll have to have a look into it to see if I can reproduce the bug...

BSOD2600
Forum Moderator
Posts: 503
Joined: 2003-01-27 23:47
Location: USA

Post by BSOD2600 » 2003-06-24 20:54

Downtime and Reliability 100.61 % LMAO

BSOD2600
Forum Moderator
Posts: 503
Joined: 2003-01-27 23:47
Location: USA

Post by BSOD2600 » 2003-06-25 06:32

In the next version, could you add an option to include/not include the /text/rules file. In my welcome message, I already put the hub rules, so reading the text/rules file is just redundant.

Also, I was noticeing the script doesnt read access.xml for the user levels/descriptions. Think that would be possbile too?

qqzm
Posts: 47
Joined: 2003-01-23 12:08

Post by qqzm » 2003-06-25 11:41

BSOD2600 wrote:Reliability 100.61 %

I'm not too surprised given that the downtime is used to calculate the reliability. I can't seem to find any reason why your downtime is screwed, it doesn't seem to want to do it for me :(

BSOD2600 wrote:In the next version, could you add an option to include/not include the /text/rules file. In my welcome message, I already put the hub rules, so reading the text/rules file is just redundant.

You could just set sRulesFile to "".

BSOD2600 wrote:Also, I was noticeing the script doesnt read access.xml for the user levels/descriptions. Think that would be possbile too?


Yeah, this is something I was already planning to do when I get around to it :)

Sedulus
Forum Moderator
Posts: 687
Joined: 2003-01-04 14:32

Post by Sedulus » 2003-06-27 14:34

nice work qqzm! =)

looking good this..
http://dc.selwerd.nl/hublist.xml.bz2
http://www.b.ali.btinternet.co.uk/DCPlusPlus/index.html (TheParanoidOne's DC++ Guide)
http://www.dslreports.com/faq/dc (BSOD2600's Direct Connect FAQ)

qqzm
Posts: 47
Joined: 2003-01-23 12:08

Post by qqzm » 2003-07-14 13:54

Version 0.2 is out in the same place as before...

Changes:
1) Now includes a stats page for each user!
2) Small bug fix.
3) Announces the stats URL to users when they login.

Check the readme.txt for upgrade instructions :)

yakko
Posts: 258
Joined: 2003-01-27 06:04

Post by yakko » 2003-07-14 14:42

I just installed it. Can you make it pick up DCH++'s userlevels? I have unregistered, registered, op, and admin as my levels, and my ops show up as VIPs. My rules also show up twice.
Also, the images1 directory is not in the archive. I grabbed it from the 1.1 one.

Other than those things it looks pretty sweet!

qqzm
Posts: 47
Joined: 2003-01-23 12:08

Post by qqzm » 2003-07-14 15:16

yakko wrote:Can you make it pick up DCH++'s userlevels? I have unregistered, registered, op, and admin as my levels, and my ops show up as VIPs.

I have my levels set as they show on the page. The titles are just in the html page, so editing the template file to replace them with your own will sort this. I'm planning to parse access.xml in a later version...haven't quite got around to it yet...


yakko wrote:My rules also show up twice.

Set your rules file to "" instead of "texts/rules". It shows your welcome message and then your rules, so if you have the rules in the welcome message you'll get them twice.


yakko wrote:Also, the images1 directory is not in the archive. I grabbed it from the 1.1 one.

D'oh. Quite stupid of me...I'll go upload a new version with the images directory in there !

yakko
Posts: 258
Joined: 2003-01-27 06:04

Post by yakko » 2003-07-14 15:49

qqzm wrote:
yakko wrote:My rules also show up twice.

Set your rules file to "" instead of "texts/rules". It shows your welcome message and then your rules, so if you have the rules in the welcome message you'll get them twice.

Thanks! That fixed it. What determines how many users are shown? I don't see even half my users in the list.

Sedulus
Forum Moderator
Posts: 687
Joined: 2003-01-04 14:32

Post by Sedulus » 2003-07-14 16:11

bad bad qqzm ;)

hardcoding "output/"...
and I was wondering where my per-user-stats went =)

well.. looking good, I think :)
http://dc.selwerd.nl/hublist.xml.bz2
http://www.b.ali.btinternet.co.uk/DCPlusPlus/index.html (TheParanoidOne's DC++ Guide)
http://www.dslreports.com/faq/dc (BSOD2600's Direct Connect FAQ)

qqzm
Posts: 47
Joined: 2003-01-23 12:08

Post by qqzm » 2003-07-14 16:59

Sedulus wrote:bad bad qqzm ;)

hardcoding "output/"...


ah nads.... I meant to go back and put that into settings... This is why I shouldn't leave things to do later because I often forget to go back and do them :)

qqzm
Posts: 47
Joined: 2003-01-23 12:08

Post by qqzm » 2003-07-14 17:01

yakko wrote:Thanks! That fixed it. What determines how many users are shown? I don't see even half my users in the list.


Can you pm me the URL of your stats so I can have a quick look? All the users currently online should show up :)

yakko
Posts: 258
Joined: 2003-01-27 06:04

Post by yakko » 2003-07-14 17:38

PM sent. BTW, I just modified the template and replaced it in the dchpp/scripts directory and it hasn't updated even after restarting the script. Is that the wrong place?

qqzm
Posts: 47
Joined: 2003-01-23 12:08

Post by qqzm » 2003-07-14 17:40

yakko wrote:PM sent. BTW, I just modified the template and replaced it in the dchpp/scripts directory and it hasn't updated even after restarting the script. Is that the wrong place?


The scripts directory is where it was stored until version 0.2 when I moved it into scripts/WebStats/.
The one in the scripts folder must be left from a previous version :)

qqzm
Posts: 47
Joined: 2003-01-23 12:08

Post by qqzm » 2003-07-14 17:46

Uploaded version 0.21 which fixes the hardcoding of the output and settings folders :)
It also sends a link to the user's personal page when he/she logs in.

Unless you *need* to change the output folder, it's not much different to version 0.2 so I wouldn't bother upgrading.

BSOD2600
Forum Moderator
Posts: 503
Joined: 2003-01-27 23:47
Location: USA

Post by BSOD2600 » 2003-07-19 04:08

Well I finally got around to installing 0.21 and LOVE the new userstats!! one big problem though...my ISP (comcast) apparently doesnt allow any non text characters on their ftp and thus about 75% of the user names aren't allowed. For example:
550-The path or filename you have entered contains forbidden characters.
550-A filename may contain only alphabetic letters in capitals (A-Z) or lower
550-case (a-z) and the numbers 0-9. The symbols dash (-), underscore (_) and
550-dot (.) may also be used. A filename may NOT start with a dot or dash.
550 Orion'sBelt.html: Forbidden filename


Yea, I suppose I could setup a webserver on my DC server (although I dont wanna since its got an underpowered cpu). Another alternative is a free webhosting site w/o popups (havn't looked around yet, but got any suggestions?).

Last option would to have an setting in the script that turned on "strict usernames" that would either 1)not create a username html file for any user with not allowed characters or 2) have the script change the generated username files and post the modified one to the client at logon.

Whatcha think?

BSOD2600
Forum Moderator
Posts: 503
Joined: 2003-01-27 23:47
Location: USA

Post by BSOD2600 » 2003-07-19 15:39

Another thing about 0.21...it seems to hang/not work occasionally. Last night I was having issues with 0.27 release 1 and thus the hub was crashing alot. This morning I got 0.27 v2 installed and webstats hasnt updated itself since last night....what gives?

qqzm
Posts: 47
Joined: 2003-01-23 12:08

Post by qqzm » 2003-07-20 10:26

The start info is saved to disk once every so often as specified in your settings. It is also saved when the hub is shutdown properly. If the hub crashes under it, it doesn't get chance to save it's data so will only have the data since the last update.

About the usernames - I'll have a look at replacing such characters with _ in the next release. :)

Sedulus
Forum Moderator
Posts: 687
Joined: 2003-01-04 14:32

Post by Sedulus » 2003-07-20 10:33

perhaps you could hash the usernames,
I don't know if that would be too cpu intensive.

unfortunately the math library doesn't include an md5 function,
and windows systems do not support popen() (otherwise you could use the md5sum program for it)
http://dc.selwerd.nl/hublist.xml.bz2
http://www.b.ali.btinternet.co.uk/DCPlusPlus/index.html (TheParanoidOne's DC++ Guide)
http://www.dslreports.com/faq/dc (BSOD2600's Direct Connect FAQ)

BSOD2600
Forum Moderator
Posts: 503
Joined: 2003-01-27 23:47
Location: USA

Post by BSOD2600 » 2003-09-07 18:47

I am wondering if it would be possible to keep some track of the share size for users. Then maybe display it on their stat page as a Max/Min/Delta or something.
That way I can get an idea of their file activity. Thanks!

BSOD2600
Forum Moderator
Posts: 503
Joined: 2003-01-27 23:47
Location: USA

BUG

Post by BSOD2600 » 2003-09-07 18:49

It seems occasionally, the webstats 0.21 gets the first and last seen reversed. For example: http://bsod2600.home.comcast.net/dch/gatorj23.html

Just in case it gets updated before you look at it:
Shared data 31.36 GB
Access level 0
First seen 11:15:01 2003/09/07
Last seen 13:56:06 2003/09/05

BSOD2600
Forum Moderator
Posts: 503
Joined: 2003-01-27 23:47
Location: USA

Post by BSOD2600 » 2003-09-07 18:56

one more bug...
http://bsod2600.home.comcast.net/dch/doomsayer.html

I know this user has been around for longer than today (as you can see from his "Words of chat" and I recall seeing him around a while ago. Anyways, the webstats shows he just arrived today, so something is not right.

Any ideas?

Who is online

Users browsing this forum: Google [Bot] and 0 guests