This repository has been archived by the owner on Mar 6, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move skeleton output into its own class. add the auth info to the output
- Loading branch information
1 parent
eb38edf
commit cb3a28e
Showing
4 changed files
with
69 additions
and
35 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
module Chatterbot | ||
|
||
# | ||
# bot template generator | ||
class Skeleton | ||
class << self | ||
def generate(bot) | ||
path = File.join(Chatterbot.libdir, "..", "templates", "skeleton.txt") | ||
src = File.read(path) | ||
opts = bot.config.merge({ | ||
:name => bot.botname, | ||
:timestamp => Time.now | ||
}) | ||
|
||
src % opts | ||
end | ||
end | ||
end | ||
end |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/usr/bin/env ruby | ||
|
||
require 'rubygems' | ||
require 'chatterbot/dsl' | ||
|
||
# | ||
# this is the script for the twitter bot %{name} | ||
# generated on %{timestamp} | ||
# | ||
|
||
consumer_key '%{consumer_key}' | ||
consumer_secret '%{consumer_secret}' | ||
|
||
secret '%{secret}' | ||
token '%{token}' | ||
|
||
# remove this to send out tweets | ||
debug_mode | ||
|
||
# remove this to update the db | ||
no_update | ||
# remove this to get less output when running | ||
verbose | ||
|
||
# here's a list of users to ignore | ||
blacklist "abc", "def" | ||
|
||
# here's a list of things to exclude from searches | ||
exclude "hi", "spammer", "junk" | ||
|
||
search "keyword" do |tweet| | ||
reply "Hey #USER# nice to meet you!", tweet | ||
end | ||
|
||
replies do |tweet| | ||
reply "Yes #USER#, you are very kind to say that!", tweet | ||
end |