safubot 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/.yardoc/checksums +5 -5
- data/.yardoc/objects/root.dat +0 -0
- data/.yardoc/proxy_types +0 -0
- data/README.md +9 -9
- data/doc/Safubot/Bot.html +334 -218
- data/doc/Safubot/Evented.html +1 -1
- data/doc/Safubot/KnownUser.html +1 -1
- data/doc/Safubot/Log.html +1 -1
- data/doc/Safubot/Problem.html +130 -0
- data/doc/Safubot/Problematic.html +282 -0
- data/doc/Safubot/Query.html +50 -1
- data/doc/Safubot/Request.html +19 -2
- data/doc/Safubot/Response.html +19 -2
- data/doc/Safubot/Test.html +1 -1
- data/doc/Safubot/Twitter/Bot.html +248 -135
- data/doc/Safubot/Twitter/DirectMessage.html +22 -22
- data/doc/Safubot/Twitter/Tweet.html +40 -40
- data/doc/Safubot/Twitter.html +1 -1
- data/doc/Safubot/XMPP/Bot.html +47 -31
- data/doc/Safubot/XMPP/Message.html +1 -1
- data/doc/Safubot/XMPP.html +1 -1
- data/doc/Safubot.html +4 -4
- data/doc/_index.html +26 -4
- data/doc/class_list.html +1 -1
- data/doc/file.README.html +11 -10
- data/doc/index.html +11 -10
- data/doc/method_list.html +103 -79
- data/doc/top-level-namespace.html +1 -1
- data/lib/safubot/bot.rb +100 -26
- data/lib/safubot/test_helper.rb +4 -0
- data/lib/safubot/twitter.rb +6 -7
- data/lib/safubot/version.rb +1 -1
- data/lib/safubot/xmpp.rb +9 -3
- data/safubot.gemspec +1 -0
- metadata +119 -113
data/.yardoc/checksums
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
lib/safubot.rb da2c6f1fa7e7a17064469e0a5409f5dc2a6ec7ab
|
2
|
-
lib/safubot/bot.rb
|
2
|
+
lib/safubot/bot.rb fe107278c4696a5ec095063612638b484b104deb
|
3
3
|
lib/safubot/log.rb c341c5e6a54a908ee8431b5aac2aa7c3472eaeed
|
4
|
-
lib/safubot/xmpp.rb
|
4
|
+
lib/safubot/xmpp.rb d09fd09c28f48282d5f09228659d58b20f69c734
|
5
5
|
lib/safubot/evented.rb 8e90ab5b812eb12113095a8bdde7a96ba0e62d1f
|
6
|
-
lib/safubot/version.rb
|
7
|
-
lib/safubot/twitter.rb
|
6
|
+
lib/safubot/version.rb f313c43342f6e25736022460f1db64f16e2562f6
|
7
|
+
lib/safubot/twitter.rb 883a32a176acdf1233e29f122d10a0cce0719664
|
8
8
|
lib/safubot/known_user.rb 8e2ce383a220c28d8729540be7fc0dfeca3f48fc
|
9
|
-
lib/safubot/test_helper.rb
|
9
|
+
lib/safubot/test_helper.rb a4ea2e3641880c51d3cdd689e47b09cffe6d0bc6
|
data/.yardoc/objects/root.dat
CHANGED
Binary file
|
data/.yardoc/proxy_types
CHANGED
Binary file
|
data/README.md
CHANGED
@@ -10,7 +10,7 @@ Safubot is a chatbot framework for Twitter and XMPP which aims to abstract away
|
|
10
10
|
Safubot uses [MongoDB](http://www.mongodb.org) for storage. It's [easy to install](http://www.mongodb.org/display/DOCS/Quickstart+Unix) and pretty awesome!
|
11
11
|
|
12
12
|
## <a name="documentation">Documentation</a>
|
13
|
-
[http://rdoc.info/gems/safubot](http://rdoc.info/gems/safubot)
|
13
|
+
[http://rdoc.info/gems/safubot/frames](http://rdoc.info/gems/safubot/frames)
|
14
14
|
|
15
15
|
## <a name="example">Sample Usage</a>
|
16
16
|
require 'safubot'
|
@@ -21,10 +21,7 @@ Safubot uses [MongoDB](http://www.mongodb.org) for storage. It's [easy to instal
|
|
21
21
|
# to do something more sophisticated than an authless localhost connection.
|
22
22
|
super(:database => "niftybot")
|
23
23
|
|
24
|
-
#
|
25
|
-
# Safubot::Twitter::Bot bot.twitter
|
26
|
-
# ::Twitter::Client bot.twitter.client
|
27
|
-
# ::TweetStream::Client bot.twitter.stream
|
24
|
+
# This creates a Safubot::Twitter::Bot instance at @twitter
|
28
25
|
enable_twitter({
|
29
26
|
:username => "niftybot",
|
30
27
|
:consumer_key => CONSUMER_KEY,
|
@@ -33,9 +30,7 @@ Safubot uses [MongoDB](http://www.mongodb.org) for storage. It's [easy to instal
|
|
33
30
|
:oauth_token_secret => OAUTH_TOKEN_SECRET
|
34
31
|
})
|
35
32
|
|
36
|
-
# Similarly,
|
37
|
-
# Safubot::XMPP::Bot bot.xmpp
|
38
|
-
# ::Blather::Client bot.xmpp.client
|
33
|
+
# Similarly, this makes a Safubot::XMPP::Bot instance at @xmpp
|
39
34
|
enable_xmpp({
|
40
35
|
:jid => "niftybot@jabber.org/niftyhost",
|
41
36
|
:password => JABBER_PASSWORD
|
@@ -81,7 +76,9 @@ Safubot::Log behaves as a Logger instance and will write to stdout by default. Y
|
|
81
76
|
|
82
77
|
### Update our twitter account
|
83
78
|
|
84
|
-
@twitter.
|
79
|
+
@twitter.on(:ready) do
|
80
|
+
@twitter.client.update("Hello there, wonderful scary world of Twitter! I am so *not* a spambot.")
|
81
|
+
end
|
85
82
|
|
86
83
|
### Reply to a non-request timeline tweet
|
87
84
|
|
@@ -97,3 +94,6 @@ Safubot::Log behaves as a Logger instance and will write to stdout by default. Y
|
|
97
94
|
@xmpp.tell('^_^@jabber.org', "You'd best be maintaining safubot!")
|
98
95
|
end
|
99
96
|
|
97
|
+
## <a name="caveats">Caveats</a>
|
98
|
+
|
99
|
+
I've yet to determine how to make multiple libraries with their own EventMachine loops play nice together, so the TweetStream and Blather clients are currently run in their own processes. Keep in mind the effect this will have on the execution context of your event handlers. MongoDB is your friend!
|