From 6dd3d0826b65f984cbdca269e68f7ed854cb570d Mon Sep 17 00:00:00 2001 From: Jacob Williams Date: Fri, 27 Jan 2012 12:34:40 -0600 Subject: [PATCH] first commit --- .gitignore | 4 ++++ Gemfile | 4 ++++ README | 3 +++ Rakefile | 1 + config-info.yml | 10 ++++++++++ lib/siriproxy-cleverbot.rb | 21 +++++++++++++++++++++ siriproxy-cleverbot.gemspec | 24 ++++++++++++++++++++++++ 7 files changed, 67 insertions(+) create mode 100644 .gitignore create mode 100644 Gemfile create mode 100644 README create mode 100644 Rakefile create mode 100644 config-info.yml create mode 100644 lib/siriproxy-cleverbot.rb create mode 100644 siriproxy-cleverbot.gemspec diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4040c6c --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +*.gem +.bundle +Gemfile.lock +pkg/* diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..25d07d2 --- /dev/null +++ b/Gemfile @@ -0,0 +1,4 @@ +source "http://rubygems.org" + +# Specify your gem's dependencies in siriproxy-example.gemspec +gemspec diff --git a/README b/README new file mode 100644 index 0000000..d48d87d --- /dev/null +++ b/README @@ -0,0 +1,3 @@ +This plugin is pretty simple and easy to use. Add the appropriate settings from the config-info.yml into your ~/.siriproxy/config.yml and bundle then start SiriProxy. +To start talking to Cleverbot just say "Talk to/with Cleverbot". Response is a little slow...it does have to post everything you say to the internet and then wait for Cleverbot to respond and then retrieve Cleverbot's response...so be patient. +To stop talking to Cleverbot all you do is say "Goodbye" for your next response. diff --git a/Rakefile b/Rakefile new file mode 100644 index 0000000..2995527 --- /dev/null +++ b/Rakefile @@ -0,0 +1 @@ +require "bundler/gem_tasks" diff --git a/config-info.yml b/config-info.yml new file mode 100644 index 0000000..cdb89eb --- /dev/null +++ b/config-info.yml @@ -0,0 +1,10 @@ +# Example configuration options that can be placed in your main SiriProxy config.yml + +############################################ +# NOTICE: Modifying these options in this +# file has no effect. You must put +# them in SiriProxy's ~/.siriproxy/config.yml +############################################ + + - name: 'Cleverbot' + git: 'git://github.com/Ponyboy47/siriproxy-cleverbot.git' diff --git a/lib/siriproxy-cleverbot.rb b/lib/siriproxy-cleverbot.rb new file mode 100644 index 0000000..956492f --- /dev/null +++ b/lib/siriproxy-cleverbot.rb @@ -0,0 +1,21 @@ +require 'cora' +require 'siri_objects' +require 'cleverbot' + +####### +# Remember to add other plugins to the "config.yml" file if you create them! +###### + +class SiriProxy::Plugin::Cleverbot < SiriProxy::Plugin +def initialize(config) +end + listen_for /Talk (to|with) Clever bot/i do + hResponse = ask "What would you like to say to Cleverbot?" + until hResponse =~ /Goodbye/i do + @cleverbot = ::Cleverbot::Client.write hResponse + hResponse = ask "#{@cleverbot['message']}" + end + say "Goodbye then.." + request_completed + end +end diff --git a/siriproxy-cleverbot.gemspec b/siriproxy-cleverbot.gemspec new file mode 100644 index 0000000..bf329fa --- /dev/null +++ b/siriproxy-cleverbot.gemspec @@ -0,0 +1,24 @@ +# -*- encoding: utf-8 -*- +$:.push File.expand_path("../lib", __FILE__) + +Gem::Specification.new do |s| + s.name = "siriproxy-cleverbot" + s.version = "0.0.1" + s.authors = ["Ponyboy47"] + s.email = ["ponyboy47@gmail.com"] + s.homepage = "" + s.summary = %q{Cleverbot Client} + s.description = %q{Talk to Cleverbot through Siri rather than having to type out everything} + + s.rubyforge_project = "siriproxy-cleverbot" + + s.files = `git ls-files 2> /dev/null`.split("\n") + s.test_files = `git ls-files -- {test,spec,features}/* 2> /dev/null`.split("\n") + s.executables = `git ls-files -- bin/* 2> /dev/null`.split("\n").map{ |f| File.basename(f) } + s.require_paths = ["lib"] + + # specify any dependencies here; for example: + # s.add_development_dependency "rspec" + # s.add_runtime_dependency "rest-client" + s.add_runtime_dependency "cleverbot" +end