in reply to Chatterbot update

> If you have noticed any other bugs,

Found another one: usernames here are case insensitive, but cb stats is distinguishing between LanX and Lanx

> just send me a private message.

oops, too late... ;)

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

Replies are listed 'Best First'.
Re^2: Chatterbot update
by cavac (Prior) on Jun 19, 2024 at 10:38 UTC

    Karma doesn't check if you upvoted a valid username (or even a valid link), it allows pretty much anything that you can write in square brackets. So, these would also be valid:

    [mod://Acme::Bleach]++ # Perfect source code obfuscation [https://bing.com]-- [id://11155739]-- # Load of rubish, doesn't work the way i want it to

    This is the relevant code in chatterbot:

    ... my $vote = 0; my ($id, $type); if($decoded =~ /\[([^\]]+?)\]([+-]{2})/) { ($id, $type) = ($1, $2); if($type eq '++') { $vote++; } elsif($type eq '--') { $vote--; } } if(!$vote) { # Not a vote contained in the message, we are done here return 1; } my $reason = ''; if($decoded =~ /^.+?\#(.*)$/) { $reason = $1; $reason =~ s/^\ +//g; $reason =~ s/\ +$//g; } ...

    In the old Tanktalus version, there where 4 sections:

    1. Most referenced Monk
    2. Most name-dropping Monk
    3. Most referenced external Hosts
    4. Karma

    This would mean my chatterbot would have to check each link in square brackets against PM to see if it was a homenode. And it would potentially list all URLs posted in the last 7 days (giving web scrapers/searchbots a greater chance to see it), no matter if you want your URL to show up there or not. By folding those functions into the Karma system, i reduced the number of server lookups and let the user choose it the URL would show up in the CB Stats.

    Changing it back to the Tanktalus version wouldn't be too hard(¹), most of the support code is in place(²). It really depends on how you people want to use it. I'm open for suggestions.

    Edit: Chatterbot does check case insensitiv since the update if the sender name and receiver link of Karma points match. Old points don't change, this is only when parsing new chat messages.


    (¹) see also: "Famous last words"
    (²) Nothing that a can of Red Bull, a bit of shouting at my monitor and some generous amount of facepalming couldn't fix.

      All of the link checking should be case insensitive. For cb stats purposes, there's never a reason to distinguish one from another based on case alone.

      And hitting the server just to check the validity (or proper casing) of a link is a bad idea — unless you cache aggressively.

        The number of CB users is small. Those garnering up votes even smaller.

        Just hardcoding those saints in a hash who where seen here in the last 2 years would certainly cover 99% of the cases.

        I wouldn't fear a DOS attack here, probably cavac should rather be worried about PM's lag and downtimes.

        Edit

        Such a data structure holding "last here" might lead to another nice feature: 😃

        A "Hello <MLX>! Long time no see" greeting 😉

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

      > I'm open for suggestions.

      If you don't want to check individual PM nodes - i.e. roughly something like \[(\w+)\] plus whitespace - maybe at least normalize them to a standard when counting

      • LanX -> Lanx
      • choroba -> Choroba
      As a second step the printed version could be the first or last or the most counted representation of the name.

      Choroba could even know better, because he's also running an external agent.

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

        To get the canonical name, I retrieve the page with ;displaytype=xml and extract its /node/@title (that's XPath).

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