Code Monkey home page Code Monkey logo

Comments (5)

oxagast avatar oxagast commented on July 30, 2024

Some points that should be included in the per user summary database:

  • Nick
  • Total number of messages since database init
  • Total number of times this user queried Franklin
  • Average line length
  • The last message this user sent to the chat
  • Estimated timezone
  • Operator status in channel
  • A short summary of the last 10 messages this user has sent to the channel.

This should be called when a user asks a question of Franklin that includes this user's nickname in chat, and it will be rolled into the DCP, independently of the question asked, for more complete context. Essentially this creates a minimal profile of each user so the bot can call on real information, instead of simply guessing.

from franklin.

oxagast avatar oxagast commented on July 30, 2024

The file format may look similar to the below for each chatter that has chatted in the channel Franklin is in.

[format version                                                          ]{4   }
[franklin ver that wrote it                                              ]{8   }
[nick (max 9 chars)                                                      ]{9   }
[null padding                                                            ]{8   }
[user summary init date (date)                                           ]{4   }
[last message date(date)                                                 ]{4   }
[num msgs since dbase init (unsigned int)                                ]{4   }
[num times queried franklin (unsigned int)                               ]{4   }
[total times this user is mentioned by other chatters(unsigned int)      }{4   }
[avg messages to all chats per hour(unsigned int)                        ]{4   }
[avg line len (short int)                                                ]{2   }
[operator status from user/voice/hop/op (byte)                           ]{1   }
[3 512 byte messages user sent as a char arr null padded(str)            ]{1536}
[null (null padding)                                                     ]{8   }
[3 random 512 byte messages sent to chat since init null padded  (str)   ]{1536}
[null padding                                                            ]{8   }
[checksum                                                                ]{4   }

from franklin.

oxagast avatar oxagast commented on July 30, 2024

Or...

{
  "versions": {
    "userfile": "1.0.0",
    "franklin": "4.0.0"
  },
  "nick": "oxagast",
  "create_date": "04182024",
  "last_messsage_date": "04192024",
  "total_messages": 55,
  "queried_bot": 12,
  "other_mentions": 3,
  "messages_per_hour": 2,
  "average_message_length": 77,
  "operator": true,
  "messages": {
    "last_messages": [
      "hello how are you",
      "oh yeah im fine",
      "yeah my name is oxagast, whats yours"
    ],
    "random_messages": [
      "blah",
      "no i like girls toes",
      "Franklin: tell me about nyc"
    ]
  },
  "checksum": "B2CCA97A"
}

from franklin.

oxagast avatar oxagast commented on July 30, 2024

Implementation ends up looking similar to:

  %summdb = ((versions => { selfver => $userfile, frankver => $franklinver }),
            ($nick => {create_date => "$create_date", change_date => "$change_date",
            total_messages => $totmsgs, queries_per_day => 0, mentions_per_day => 0,
            messages_per_day => 0, average_message_length => 0, operator => false,
            (messages => {last => [ $lastm[0], $lastm[1], $lastm[2] ],
            random => [ $rndm[0], $rndm[1], $rndm[2] ]})}));
  $json_nick = create_json (\%summdb);

from franklin.

oxagast avatar oxagast commented on July 30, 2024

Thus the .json in the database, written by franklin_profiler.pl, ends up being something similar to:

{
  "oxagast": {
    "total_messages": "222",
    "messages": {
      "last": [
        "sorry for all the pings man",
        "my ad",
        "jeez 50 percent?",
        "thats insane",
        "fuck",
        "Franklin: how long is aestetix's average text on irc",
        "Franklin: how many queries have i made to you today Franklin ",
        "not yet"
      ],
      "random": []
    },
    "operator": "false",
    "queries_per_day": "66",
    "change_date": "05-14-2024",
    "messages_per_day": "221",
    "average_message_length": "26.3021819591497",
    "create_date": "05132024"
  },
  "versions": {
    "selfver": "1.2.0",
    "frankver": "4.5.0"
  }
}

This is then parsed in franklin.pl, and stuck on the end of the DCP for both the user calling Franklin, as well as any users that they mention in the query.

Currently the things recorded and updated in the user dbase are:

  • Franklin compatibility version
  • Profiler version
  • Average message length
  • Create date
  • Modify date
  • Queries per day
  • Messages per day
  • All time message count
  • If the user is an operator in any channel franklin is in
  • The previous eight messages by that user
  • Eight randomly selected messages by that user

The result?
franklin-in-action

from franklin.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.