• Top-5 User Bulletin Generator

    From Codefenix@CONCHAOS to All on Friday, January 14, 2022 17:10:54
    As seen in the Facebook group this week, this is a javascript I came up with which parses Synchronet's log files and generates a MSG bulletin of the top 5 users in different categories (top five callers, top five posters, top five message readers, top five uploaders/downloaders, etc.).

    https://github.com/CraigEMP/topfives.js

    You can call it on the command line or as a timed event, specifiy "month" or "year" bulletins, and display the output to your users during login.

    By default it outputs an animated bulletin containing AT codes to control the cursor movements and delays, but it can optionally write to a "simple" bulletin instead.

    It works by doing a wildcard search of all the *.log files for the specified month/year in the /data/logs directory, keeps a tally of the stats within each. It ignores MS*.log files in an attempt to speed up the search, but as Rob/digital man pointed out, there are other log types which also should be skipped (FS*.log and http*.log), so I'll make an edit to the script very soon to ignore these as well. (thanks dm!)

    I got the for it idea from seeing various top 5 and top 10 lists on other boards. I used to see them all the time on WWIV boards back in my hometown during the 90s, and they're fairly common today on a lot of Mystic boards. There are a few tools already available that generate similar lists for Synchronet (syncdoor, syncstat, and top10usr to name a few), but frankly the output from those is fairly lackluster in my opinion, so I decided to try my hand at making my own.

    I hope people find it useful.

    ---
    ■ Synchronet ■ -=[ conchaos.synchro.net | ConstructiveChaos BBS ]=-
  • From Digital Man to Codefenix on Friday, January 14, 2022 14:53:12
    Re: Top-5 User Bulletin Generator
    By: Codefenix to All on Fri Jan 14 2022 05:10 pm

    It works by doing a wildcard search of all the *.log files for the specified month/year in the /data/logs directory, keeps a tally of the stats within each. It ignores MS*.log files in an attempt to speed up the search, but as Rob/digital man pointed out, there are other log types which also should be skipped (FS*.log and http*.log), so I'll make an edit to the script very soon to ignore these as well. (thanks dm!)

    As I mentioned on FB too, you probably should do an *inclusive* search (i.e. only files matching the pattern MMDDYY.log) rather than *excluding* files of other specific naming patterns. You never know when new *.log files may appear in the data/logs dir with other naming formats.

    Also, did you consider the .lol files (same directory) - maybe they contain all the stats you need?
    --
    digital man (rob)

    Sling Blade quote #16:
    Karl Childers (to Doyle, re: lawn mower blade): I aim to kill you with it. Mmm. Norco, CA WX: 76.3°F, 17.0% humidity, 5 mph WNW wind, 0.00 inches rain/24hrs
  • From Codefenix@CONCHAOS to Digital Man on Friday, January 14, 2022 20:29:33
    Re: Top-5 User Bulletin Generator
    By: Digital Man to Codefenix on Fri Jan 14 2022 02:53 pm

    As I mentioned on FB too, you probably should do an *inclusive* search (i.e. only files matching the pattern MMDDYY.log) rather than *excluding* files of other specific naming patterns. You never know when new *.log files may appear in the data/logs dir with other naming formats.

    That was my first thought as well, but I couldn't think of how the wildcard search pattern would look if only a year was specified for a yearly bulletin.
    It would look like /sbbs/data/logs/*22.log, unless I'm overlooking something obvious.

    Also, did you consider the .lol files (same directory) - maybe they contain all the stats you need? --

    I decided against the .lol files, since their status is "discouraged" on the http://wiki.synchro.net/ref:files page. Also, they don't track door usage.

    ---
    ■ Synchronet ■ -=[ conchaos.synchro.net | ConstructiveChaos BBS ]=-
  • From Digital Man to Codefenix on Friday, January 14, 2022 17:47:05
    Re: Top-5 User Bulletin Generator
    By: Codefenix to Digital Man on Fri Jan 14 2022 08:29 pm

    Re: Top-5 User Bulletin Generator
    By: Digital Man to Codefenix on Fri Jan 14 2022 02:53 pm

    As I mentioned on FB too, you probably should do an *inclusive* search (i.e. only files matching the pattern MMDDYY.log) rather than *excluding* files of other specific naming patterns. You never know when new *.log files may appear in the data/logs dir with other naming formats.

    That was my first thought as well, but I couldn't think of how the wildcard search pattern would look if only a year was specified for a yearly bulletin. It would look like /sbbs/data/logs/*22.log, unless I'm overlooking something obvious.

    "????22.log" would be a valid glob/directory pattern to only match files with exactly 8 characters in the base filename and the last part matching "22.log". Even better would be to use a regular expression that matched against 8 decimal digits (e.g. /\d\d\d\d\d\d\d\d\.log/). There are lot of methods of comparing/matching against regexp's in JS, here's one:
    https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/test


    Also, did you consider the .lol files (same directory) - maybe they contain all the stats you need? --

    I decided against the .lol files, since their status is "discouraged" on the http://wiki.synchro.net/ref:files page. Also, they don't track door usage.

    Ah. Cool. Just wanted to make sure you were aware of their existence. I suppose it could be extended to include door usage if there was any other issue with the .log files (e.g. performance).
    --
    digital man (rob)

    Synchronet/BBS Terminology Definition #16:
    CR = Carriage Return (ASCII 13, Ctrl-M)
    Norco, CA WX: 69.7°F, 20.0% humidity, 14 mph ENE wind, 0.00 inches rain/24hrs
  • From MRO@BBSESINF to Codefenix on Friday, January 14, 2022 19:30:32
    Re: Top-5 User Bulletin Generator
    By: Codefenix to All on Fri Jan 14 2022 05:10 pm

    As seen in the Facebook group this week, this is a javascript I came up with which parses Synchronet's log files and generates a MSG bulletin of the top 5 users in different categories (top five callers, top five posters, top

    ew. facebook
    ---
    ■ Synchronet ■ ::: BBSES.info - free BBS services :::
  • From Codefenix@CONCHAOS to Digital Man on Saturday, January 15, 2022 10:35:46
    Re: Top-5 User Bulletin Generator
    By: Digital Man to Codefenix on Fri Jan 14 2022 05:47 pm

    "????22.log" would be a valid glob/directory pattern to only match files with exactly 8 characters in the base filename and the last part matching "22.log". Even better would be to use a regular expression

    Awesome. The question mark notation of "????22.log" works great and is what I ended up going with. I updated the code on git.

    I may revisit with a regex approach at some point, but this certainly does the job for now. :)

    Thanks again!

    ---
    ■ Synchronet ■ -=[ conchaos.synchro.net | ConstructiveChaos BBS ]=-
  • From Codefenix@CONCHAOS to MRO on Saturday, January 15, 2022 10:42:07
    Re: Top-5 User Bulletin Generator
    By: MRO to Codefenix on Fri Jan 14 2022 07:30 pm

    ew. facebook

    I know. I have no excuse.

    I initially posted a quick demo of the script's output to my board's FB page, and then shared that post to the Synchronet FB group. When people asked if I would share the script, I made a second post on the FB group after I felt the script was ready to be shared.

    Now I realize it was all better off originating here in this DOVE-Net sub.

    Oh well.

    ---
    ■ Synchronet ■ -=[ conchaos.synchro.net | ConstructiveChaos BBS ]=-
  • From MRO@BBSESINF to Codefenix on Saturday, January 15, 2022 16:24:14
    Re: Top-5 User Bulletin Generator
    By: Codefenix to MRO on Sat Jan 15 2022 10:42 am

    Re: Top-5 User Bulletin Generator
    By: MRO to Codefenix on Fri Jan 14 2022 07:30 pm

    ew. facebook

    I know. I have no excuse.

    I initially posted a quick demo of the script's output to my board's FB page, and then shared that post to the Synchronet FB group. When people asked if I would share the script, I made a second post on the FB group after I felt the script was ready to be shared.

    Now I realize it was all better off originating here in this DOVE-Net

    sub.

    Oh well.

    i think we should just make a telegram group for synchronet.
    today i setup a telegram to irc gateway and they could do that with irc.synchro.net and a telgram group.
    it's pretty cool. pasted pics and videos work.

    i think we should all abandon facebook. i know it's hard because everyone's using it but facebook isnt our friend.

    ---
    ■ Synchronet ■ ::: BBSES.info - free BBS services :::
  • From Fr333n3rgy@ORACLE to MRO on Tuesday, January 18, 2022 22:20:41
    Re: Top-5 User Bulletin Generator
    By: MRO to Codefenix on Sat Jan 15 2022 04:24 pm

    i think we should all abandon facebook. i know it's hard because everyone's using it but facebook isnt our friend.

    100% agree - in my household facebook.com is blacklisted lol.

    Time to move on :-)

    ---
    ■ Synchronet ■ The Oracle BBS