plasticuproject / cleverbotfree

Free alternative for the Cleverbot API
GNU General Public License v3.0
58 stars 6 forks source link

Changed the get_response method to get quicker responses from the app #10

Closed Devansh-bit closed 3 years ago

Devansh-bit commented 3 years ago

The sleeps in the get_response method make the response time very long. For overcoming this, the share button appearing in front of output line (Maybe added recently) has been used to detect the completion of the output. The button appears as soon as the app starts to send a response, but reaches full opacity value of 1 only on the completion of the output.

Devansh-bit commented 3 years ago

@plasticuproject

I have added the changes you suggested in with the exception of the StaleElementReferenceException, with reference to Issue #3 . The reason being that I tested the library for quite some time, 370 calls to be exact, and I was unable to replicate the error in Issue #3 . Even before this, I used a script very similar to this library and have made at least 1000 calls in a single session. I guess they removed the pagination you mentioned in the issue. If you insist, I can still add it back! (Sorry for so many edits >.<) The result of my 370 call testing - test.txt

plasticuproject commented 3 years ago

Sorry, after some testing I found that using the share button was unreliable in production. When able to send multiple messages before a response was received (like with my discord bot implementation) the share button would stay on the page or not show up at all. Currently the module is a little slow, but works pretty reliably with multiple users sending asynchronous messages. I'm pretty bummed out as I was looking forward to the increased speed, but ultimately reliability across applications is more important.