Skip to content

Commit

Permalink
Merge pull request #38 from wardellchandler/cleverbot_fix
Browse files Browse the repository at this point in the history
Fixes #34: Uses fix from @ShaunOfTheLive's fork of the bot. Thanks a ton!
  • Loading branch information
wardellbagby committed Jun 10, 2015
2 parents ad75963 + 42d9001 commit 73e799d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Libraries/cleverbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import urllib
import uuid
import xml.dom.minidom
from http import cookiejar

"""
chatterbotapi
Expand Down Expand Up @@ -96,7 +97,10 @@ def think_thought(self, thought):
data_digest = hashlib.md5(data_to_digest.encode('utf-8')).hexdigest()
data = data + '&icognocheck=' + data_digest
data = data.encode('utf-8')
url_response = urllib.request.urlopen(self.bot.url, data)
cj = cookiejar.CookieJar()
opener = urllib.request.build_opener(urllib.request.HTTPCookieProcessor(cj))
opener.open('http://www.cleverbot.com')
url_response = opener.open(self.bot.url, data)
response = url_response.read()
response_values = response.decode('utf-8').split('\r')
# self.vars['??'] = _utils_string_at_index(response_values, 0)
Expand Down

0 comments on commit 73e799d

Please # to comment.