kiwiirc meme script

by Michael Dibbets

HTML

<span style="color:purple">
hit F12<BR/>
set execution context of console to kiwiirc.com<BR/>
then paste the below code.<BR/>
</span>
<input type="text" class="inp" style='float:right'>

JavaScript

function kiwiMemeManager() {
      var that = this;
      var manager = this;
      var button = $(document.createElement('input'));
      button.attr('type','button');
      button.val("Show/hide memes");
      button.on('click',function() {
           if($('#contentmeme').is(":visible")) {
              that.hideMemes();
              }
           else {
              that.showMemes();
           }
       });
     button.css({"position":"absolute","top":"50px","left":"5px","width":"200px","height":"25px"});
    $(document.body).append(button);
    kiwi.events.on('message:new',function(ignore,msg){
      var message = msg.message;
      if(message.msg.indexOf('You\'re doing good work,') == 0) { 
        var name = message.msg.substring('You\'re doing good work, '.length, message.msg.length-1);
        that.addRating(name);
      }
      if(message.msg.indexOf('!score ') == 0) { 
        var name = message.msg.substring('!score '.length, message.msg.length);
        var rating = that.getRating(name);
        msg.network.say(msg.message.target, 'Hello there, ' + msg.message.nick + '! The rating of `'+name+'` is '+rating+' points!');        
        console.log(msg.message.target, 'Hello there, ' + msg.message.nick + '! The rating of `'+name+'` is '+rating+' points!');
      }
      if(message.msg.indexOf('!top10') == 0) { 
           val = manager.getTop10();
           msg.network.say(msg.message.target,val);
           console.log(val);
        }
    });
    this.bootManualInputListener();
}
kiwiMemeManager.prototype.getMemes = function() {
   try {
      return JSON.parse(window.localStorage.getItem('memes'));
   }
   catch(e) {
     window.localStorage.removeItem('memes');
      return {};
   }
}
kiwiMemeManager.prototype.storeMemes = function(memes) {
     window.localStorage.setItem('memes',JSON.stringify(memes));
}
kiwiMemeManager.prototype.findMeme = function(searchkey) {
    var obj = this.getMemes();
for(var item in obj) {
   if(obj.hasOwnProperty(item))...