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 CHANGED
@@ -1,9 +1,9 @@
1
1
  lib/safubot.rb da2c6f1fa7e7a17064469e0a5409f5dc2a6ec7ab
2
- lib/safubot/bot.rb 91a9512ec77a70a4a3bf3d1235d81f546cae7765
2
+ lib/safubot/bot.rb fe107278c4696a5ec095063612638b484b104deb
3
3
  lib/safubot/log.rb c341c5e6a54a908ee8431b5aac2aa7c3472eaeed
4
- lib/safubot/xmpp.rb 253c1ef4b93f85f4cfd55d8fb561984eb1bcf151
4
+ lib/safubot/xmpp.rb d09fd09c28f48282d5f09228659d58b20f69c734
5
5
  lib/safubot/evented.rb 8e90ab5b812eb12113095a8bdde7a96ba0e62d1f
6
- lib/safubot/version.rb 67c555f319499e0bcc596a73152df9f0797da190
7
- lib/safubot/twitter.rb 414b3cabef1611923f18d779d279ce0b6f3128b8
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 892633f1707378964059f7209da7771669fdb993
9
+ lib/safubot/test_helper.rb a4ea2e3641880c51d3cdd689e47b09cffe6d0bc6
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
- # To access the underlying delegation targets:
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, for XMPP:
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.client.update("Hello there, wonderful, scary world of Twitter! I am so *not* a spambot.")
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!