pierredavidbelanger / chatter-bot-api

A Mono/.NET, JAVA, Python and PHP chatter bot API that supports Cleverbot, JabberWacky and Pandorabots.
182 stars 72 forks source link

404 on Cleverbot #9

Closed magalvao closed 9 years ago

magalvao commented 9 years ago

The PHP example is not working on my machine. On the PHP error log:

[Wed Jun 03 16:33:37 2015] [error] PHP Warning: fopen(http://www.cleverbot.com/webservicemin): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found\r\n in files/cleverbot/chatterbotapi.php on line 255 [Wed Jun 03 16:33:37 2015] [error] PHP Warning: stream_get_contents() expects parameter 1 to be resource, boolean given in files/cleverbot/chatterbotapi.php on line 256 [Wed Jun 03 16:33:37 2015] [error] PHP Warning: fclose() expects parameter 1 to be resource, boolean given in files/cleverbot/chatterbotapi.php on line 257

There is something wrong on the Cleverbot side?

pierredavidbelanger commented 9 years ago

You are right, even in the browser, http://www.cleverbot.com/webservicemin is giving me a 404.

Either CleverBot is down momentarily, or they changed their WebService so we can no longer use it.

PhoenixICE commented 9 years ago

http://www.cleverbot.com/webservicemin is giving me DENIED +3000_cbfull atm hmm...

robomaeyhem commented 9 years ago

Looks like Jabberwacky is also returning 404 via http://www.existor.com/webservicemin

sbwMikael commented 9 years ago

That ends my confusion, at least. I stumbled across this project earlier today, and had started work on integrating it into a game, but couldn't understand why I wasn't getting any bot responses. I'll keep coming back for updates, but I hope this is only a temporary state of affairs.

pierredavidbelanger commented 9 years ago

I will take a look at this problem today.

ghost commented 9 years ago

Any update on this? Is this api done?

pierredavidbelanger commented 9 years ago

Yeah, their web service was changed. I will need to reverse engineer the flow once again. This will take some time.

ghost commented 9 years ago

When you visit the cleverbot.com website and after that http://www.cleverbot.com/webservicemin isn't returning 404 anymore. But "DENIED +3000_cbfull" not sure whats this about... Any Idea?

ghost commented 9 years ago

When is this going to be fixed? :(

wardellbagby commented 9 years ago

@pierredavidbelanger You might want to look into this. I have a bot that uses Hangouts, and I was using a cleverbot api for it. One of my forks came up with a fix for the api I was uses; they saved the cookies and it worked. Check out this commit here:

https://github.com/wardellchandler/HangoutsBot/commit/42d90010aa232768320de9b1c3a47ff0cc740be0

pierredavidbelanger commented 9 years ago

@wardellchandler Nice, I will try this as soon as I find a couple minutes.

ghost commented 9 years ago

It worked! Awesome :)

ghost commented 9 years ago

Pull request. Maybe not beautiful but works :) https://github.com/pierredavidbelanger/chatter-bot-api/pull/10

robomaeyhem commented 9 years ago

Any word on a Java solution?

pierredavidbelanger commented 9 years ago

I have a working fix for the Java version. I will push it (in Github and Maven Central) this evening (around 20h, this is in about 3 or 4 hours).

sbwMikael commented 9 years ago

Thanks very much for the updates, really appreciate it. My PHP experience is really limited so I don't know how relevant this is, but I made one small change to the updated chatterbotapi.php on line 164 because I was getting a script warning about "split" being deprecated, so I just swapped this for "explode".

pierredavidbelanger commented 9 years ago

Its deployed on maven. It should be visible anytime soon.

robomaeyhem commented 9 years ago

Jabberwacky comes back as an empty string every time in Java it seems

remiscarlet commented 9 years ago

Any information on the python side of things being updated?

pierredavidbelanger commented 9 years ago

I am sorry guys, I did not had the time to really fix every port of the library. I can not give you an ETA either.

Feel free to contribute :)

The fix is really simple:

1) The Session object now have a new variable to hold the cookies https://github.com/pierredavidbelanger/chatter-bot-api/blob/master/java/src/main/java/com/google/code/chatterbotapi/Cleverbot.java#L40

2) When a new Session is created, the variable is initialized https://github.com/pierredavidbelanger/chatter-bot-api/blob/master/java/src/main/java/com/google/code/chatterbotapi/Cleverbot.java#L50

3) And a GET is issued to Cleverbot the get all the cookies: https://github.com/pierredavidbelanger/chatter-bot-api/blob/master/java/src/main/java/com/google/code/chatterbotapi/Cleverbot.java#L52

4) The request method in the Utils class, now take care of reading the cookie from the response: https://github.com/pierredavidbelanger/chatter-bot-api/blob/master/java/src/main/java/com/google/code/chatterbotapi/Utils.java#L81

5) Then, when the think method is called, we issue a request using the Session cookies: https://github.com/pierredavidbelanger/chatter-bot-api/blob/master/java/src/main/java/com/google/code/chatterbotapi/Cleverbot.java#L66

6) The request method in the Utils class also take care of sending cookies: https://github.com/pierredavidbelanger/chatter-bot-api/blob/master/java/src/main/java/com/google/code/chatterbotapi/Utils.java#L63

sbwMikael commented 9 years ago

EDIT: obviously I should have waited a bit longer to confirm this (sorry for the email alerts). Apparently it was a temporary problem and things are working again now. But I'll probably deactivate it (on our game server) for the time-being all the same.

--- older message ---

Seems something has changed again? Or else I'm experiencing localised troubles. But as of an hour ago or so, I was initially getting just ads for something called "Clevertweet" and then blank responses.

I think I'll bow out now though. I just wanted to add botchat as a feature for visitors to our game server during slow periods, but it's not something we can't live without. Thanks for the project

pierredavidbelanger commented 9 years ago

The simple PHP version is also fixed.

pierredavidbelanger commented 9 years ago

Also fixed in the python version.

robomaeyhem commented 9 years ago

Jabberwacky still looks like it's returning an empty String in the Java version, regardless of what is inputted

pierredavidbelanger commented 9 years ago

Also fixed in the .NET version thanks to @KSemenenko 's nice Pull Request. He bump the .NET requirement from 2.0 to 4.5 though. I hope everyone using the .NET version is ok with this.

AldeRoberge commented 7 years ago

Java is still not working

pierredavidbelanger commented 7 years ago

@iObsidian I just tried the example code with the latest maven version and it worked.

Ensure you are using the latest version, and If it still does not work for you, please open a new issue with a description of what you are doing, what you expect, what you see instead and ideally a stack trace if you have one.

AldeRoberge commented 7 years ago

Hey Pierre, thanks for answering! Pandora bots works while clever bot doesn't. Thanks for your time :)