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:
- Most referenced Monk
- Most name-dropping Monk
- Most referenced external Hosts
- 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.
|