Created
January 14, 2011 11:20
-
-
Save mconnell/779493 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# found this the other day while looking for something entirely different.. | |
# http://webcache.googleusercontent.com/search?q=cache:s4vKoo5lpwoJ:blog.viamentis.com/articles/category/ruby/page/2/+chat+AI+ruby&cd=10&hl=en&ct=clnk&client=safari | |
require 'net/http' | |
def eliza(str) | |
response = Net::HTTP.post_form(URI.parse("http://www-ai.ijs.si/eliza-cgi-bin/eliza_script"),{'Entry1'=>str}) | |
return response.body.split("</strong>\n").last.split("\n").first | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment