I am trying to find the best way to track all new messages in chat, as well as specific emoticons. Similar to what http://kappa.ws/ does, but on a channel scale, not global.
You would basically need to build a chat bot that reads chat and stores the emote frequency in the database. You can read over the IRC documentation to get started with that. There are a few community-supported frameworks that will help you interface with IRC depending on your programming language of choice.