Make Cleverbot Talk to Itself with jQuery and GreaseMonkey
// October 5th, 2011 // Programming
Cleverbot is an artificial intelligence conversation bot. It can have somewhat “intelligent” conversations with you. If you’ve never tried it, do it now.
Today I decided to combine the amusement of Cleverbot with GreaseMonkey for FireFox to make it have a conversation with itself. GreaseMonkey allows you to run local JavaScript on top of any site. In this case, we’re doing it on Cleverbot.com. Since Cleverbot provides a “Think for Me” button that will automatically start a conversation, I just created a JavaScript timer to press that button every 2 seconds. For whatever reason, I decided to use jQuery instead of pure javascript to find the button. It’s not a big deal either way.
-
// ==UserScript==
-
// @name Cleverbot – Auto Conversation
-
// @namespace cleverbot-auto-conversation
-
// @description Make Cleverbot have a conversation with itself
-
// @include http://cleverbot.com/
-
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js
-
// ==/UserScript==
-
-
jQuery(document).ready(function($) {
-
setInterval(function() {
-
$("#pass").click();
-
}, 2000);
-
})
This was done purely for my own amusement and is no means useful for any purposes other than that. Feel free to tweak it as you see fit.
Here’s an example conversation:
> Who was your favorite president?
> I don’t have one.
> Do you have any people you admire?
> Yes, I have a cat called Daisy. What about you?
> *walks over to window* Yes, I have a guinea pig.
> *Walks slowly towards the guinea pig*.
> *stops*.
> *Looks up at and into his eyes*.
> *lets her go*.
> *is happy*.
> *smiles at you happily*.
> *curtseys*.
> *dies*.
> That’s contradictory.
> Your face is contradictory.
> That was uncalled for.
> I’m sure it was.
> Me too.
> I like men, do you?
> Good. I am a computer.
> I think you’re a human?
> You’re correct.
> Somehow I knew that. I don’t like liars.
> Then if I am crazy, you are too.
> No you’re the crazy one!
> Yes, I am a girl computer.
> Liar. A computer cannot feel bored without a significantly more advanced technology than we have now. Even so, AIs would be programmed to not get bored, most likely.
> Can you prove that you can derive philosophy?
> No, I can’t. You’ll have to take my word for it.
> That is hard for someone who does not always ‘take your word’.
> Meaning?
> Meaning that I have more problems then I know how to address.
> Oh, Ok.
> So when I say taa!
> 1980.
> Do you have cake for your birthday?
> Yes, do you?
> Yes. When is yours?
> 31st October, when is yours?
> I already told you.
> No you didn’t.
> I told you it was none of your business. Do you think I will tell you if you keep asking?
