Code to spam:
var $ci = $('.chat-input');
var str = "spammy string";
setInterval(function() {
$ci.value = str;
document.horse.whinny();
}, 50);