Skip to content

Instantly share code, notes, and snippets.

@mconnell
Created January 14, 2011 11:20
Show Gist options
  • Save mconnell/779493 to your computer and use it in GitHub Desktop.
Save mconnell/779493 to your computer and use it in GitHub Desktop.
# 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