I spent the day rummaging around in chatterbots brain. It now understands Karma and displays it in cb stats.

You can just do:

[LanX]++ [NodeReaper]-- I disagree! [NodeReaper]-- shouldn't have reaped my post!

Yes, negative Karma also works. The feature is quite flexible, pretty much anything in square brackets that the Monastery can turn into links can be given Karma. So if you like, for example, CB Stats, you can do:

[id://11155739]++

Karma-Parsing is rather simple minded:

... my $vote = 0; if($decoded =~ /\[([^\]]+?)\]([+-]{2})/) { ($id, $type) = ($1, $2); if($type eq '++') { $vote++; } elsif($type eq '--') { $vote--; } } ...

Karma points are tracked for 7 days. Well, technically, they remain in my database forever. But to match the other CB Stats, i only look at the last 7 days.

I also track WHO is handing out the points and show the 5 most active Karma givers in the stats as well.

Another special feature is that chatterbot can watch homenodes and "last seen" time and show last online time of a user. This may have serious timezone bugs!. I'm not sure if this feature is of any use, other than novelty. I configured some random users at the moment to test the stability of my homenode parser.

PerlMonks XP is useless? Not anymore: XPD - Do more with your PerlMonks XP

Replies are listed 'Best First'.
Re: Chatterbox KARMA support
by choroba (Cardinal) on Apr 22, 2024 at 10:44 UTC
    Great work!

    As usually, when you implement something, users start coming with feature requests. So, here's mine: The old cbstats also showed the reason why the karma was given (I guess just the message with the [user]++ everything before the first # removed). So I was used to typing something like

    [user]++ # patching the core

    Would that be possible in the new cb stats, too?

    Update: Fixed the link, ThanX LanX.

    Update 2: Changed the description to include the octothorpe. Thanks to LanX and jdporter.

    map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

      Would that be possible in the new cb stats, too?

      Computer says no!

      Well, actually i didn't even remember that this was a thing, even though i have screenshots (and source code) of the old site.

      It's now implemented. If you like to change anything (add timestamps, add the karma giver, etc), just let me know.

      BTW, anyone remember how to format HTML tables in the Monastery more nicely? You now, alternating table rows with slightly different backgrounds, using the user-selected stylesheets? I haven't played with that stuff on PM for so long, i've completely forgotten if that's even in the default stylesheets.

      PerlMonks XP is useless? Not anymore: XPD - Do more with your PerlMonks XP
        > you now, alternating table rows with slightly different backgrounds,

        If you look into Perl Monks Approved HTML tags (it's automatically linked when you comment) you'll see a list of allowed attributes per tag.

        tbody width, align, valign, colspan, rowspan, bgcolor, height, class td width, align, valign, colspan, rowspan, bgcolor, height, class tfoot width, align, valign, colspan, rowspan, bgcolor, height, class th width, align, valign, colspan, rowspan, bgcolor, height, class thead width, align, valign, colspan, rowspan, bgcolor, height, class tr width, align, valign, colspan, bgcolor, height, class

        you can go by class or bgcolor,

        > using the user-selected stylesheets?

        OK that's a bit trickier ... are you talking about themes?

        The monastery has a default set of CSS which is altered by theme. Users can overwrite whatever they want in their settings.

        I'm not aware of classes for tables, but you can look into the HTML of existing tables° or the CSS in the settings section.

        And if they don't exists, I'm sure the gods will grant you a wish to create them ... :)

        edit

        °) Saints in our Book is using <tr class="highlight"> for that.

        Cheers Rolf
        (addicted to the Perl Programming Language :)
        see Wikisyntax for the Monastery

      It's cb stats with a whitespace

      > (I guess just the message with the [user]++ removed)

      > [user]++ # patching the core

      What I remember was only the part after the #

      Edit

      So

      That's great feature request [choroba]++ :) # nitpicking PITA

      would only record nitpicking PITA

      ;-P

      Cheers Rolf
      (addicted to the Perl Programming Language :)
      see Wikisyntax for the Monastery

        only the part after the #

        I am certain that that was the case. In fact, I think it was explicitly documented that way.

Re: Chatterbox KARMA support
by LanX (Saint) on Apr 23, 2024 at 10:25 UTC
    May I suggest 3,5 new things???

    CB stats is currently quite long ...

    1. Please add a TOC at the top to jump to the #sections
    2. Sum up karma points by comment - especially no comment - instead of listing them separately (COUNT/ GROUP BY)
    3. insert a backlink to this thread, so people can read up and submit new proposals ( or a link to the next entry)
    4. Patch Chatterbox FAQ to mention "karma" at the corresponding entry: "What is chatterbot and how do i use it?

    Besides, this "snapshot feature"... Doesn't it violate the policy of "chats are not recorded"?

    edit

    See Q: Is the Chatterbox logged anywhere?#logged

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    see Wikisyntax for the Monastery

    Update

    In hindsight, documentation is a complicated issue here, because there are multiple pages involved, like the chatterbox home.

      The cb stats are a work in progress and will get cleaned up quite a bit.

      The snapshot feature is basically a convencience feature. Basically a text based screenshot. I find it quite useful, especially if it contains answers to my question (so i can properly copy&paste later when i have time).

      If you send the snapshot request via private message to chatterbot, only you will get the snapshot link.

      According to my database, there are currently a total of 5(!) snapshots since November 2023, which includes the 4 i made. This is a total of 47 lines of text.

      PerlMonks XP is useless? Not anymore: XPD - Do more with your PerlMonks XP
        Look, I'm not against snapshots.

        But I remember tense conversations between a god and your predecessor, when he started providing something like public logs.

        Both aren't active anymore, but if the policy has changed, this should be announced properly.

        On a side note: if perlmonks was written today, people would probably have to consent for their chats being displayed to non-locked AnoMonk.

        Cheers Rolf
        (addicted to the Perl Programming Language :)
        see Wikisyntax for the Monastery