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/doc/file.README.html CHANGED
@@ -71,7 +71,7 @@
71
71
 
72
72
  <h2><a name="documentation">Documentation</a></h2>
73
73
 
74
- <p><a href="http://rdoc.info/gems/safubot">http://rdoc.info/gems/safubot</a></p>
74
+ <p><a href="http://rdoc.info/gems/safubot/frames">http://rdoc.info/gems/safubot/frames</a></p>
75
75
 
76
76
  <h2><a name="example">Sample Usage</a></h2>
77
77
 
@@ -83,10 +83,7 @@
83
83
  </span> <span class='comment'># to do something more sophisticated than an authless localhost connection.
84
84
  </span> <span class='kw'>super</span><span class='lparen'>(</span><span class='symbol'>:database</span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>niftybot</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
85
85
 
86
- <span class='comment'># To access the underlying delegation targets:
87
- </span> <span class='comment'># Safubot::Twitter::Bot bot.twitter
88
- </span> <span class='comment'># ::Twitter::Client bot.twitter.client
89
- </span> <span class='comment'># ::TweetStream::Client bot.twitter.stream
86
+ <span class='comment'># This creates a Safubot::Twitter::Bot instance at @twitter
90
87
  </span> <span class='id enable_twitter'>enable_twitter</span><span class='lparen'>(</span><span class='lbrace'>{</span>
91
88
  <span class='symbol'>:username</span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>niftybot</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span>
92
89
  <span class='symbol'>:consumer_key</span> <span class='op'>=&gt;</span> <span class='const'>CONSUMER_KEY</span><span class='comma'>,</span>
@@ -95,9 +92,7 @@
95
92
  <span class='symbol'>:oauth_token_secret</span> <span class='op'>=&gt;</span> <span class='const'>OAUTH_TOKEN_SECRET</span>
96
93
  <span class='rbrace'>}</span><span class='rparen'>)</span>
97
94
 
98
- <span class='comment'># Similarly, for XMPP:
99
- </span> <span class='comment'># Safubot::XMPP::Bot bot.xmpp
100
- </span> <span class='comment'># ::Blather::Client bot.xmpp.client
95
+ <span class='comment'># Similarly, this makes a Safubot::XMPP::Bot instance at @xmpp
101
96
  </span> <span class='id enable_xmpp'>enable_xmpp</span><span class='lparen'>(</span><span class='lbrace'>{</span>
102
97
  <span class='symbol'>:jid</span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>niftybot@jabber.org/niftyhost</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span>
103
98
  <span class='symbol'>:password</span> <span class='op'>=&gt;</span> <span class='const'>JABBER_PASSWORD</span>
@@ -148,7 +143,9 @@
148
143
 
149
144
  <h3>Update our twitter account</h3>
150
145
 
151
- <pre class="code"><span class='ivar'>@twitter</span><span class='period'>.</span><span class='id client'>client</span><span class='period'>.</span><span class='id update'>update</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Hello there, wonderful, scary world of Twitter! I am so *not* a spambot.</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
146
+ <pre class="code"><span class='ivar'>@twitter</span><span class='period'>.</span><span class='id on'>on</span><span class='lparen'>(</span><span class='symbol'>:ready</span><span class='rparen'>)</span> <span class='kw'>do</span>
147
+ <span class='ivar'>@twitter</span><span class='period'>.</span><span class='id client'>client</span><span class='period'>.</span><span class='id update'>update</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Hello there, wonderful scary world of Twitter! I am so *not* a spambot.</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
148
+ <span class='kw'>end</span>
152
149
  </pre>
153
150
 
154
151
  <h3>Reply to a non-request timeline tweet</h3>
@@ -166,10 +163,14 @@
166
163
  <span class='ivar'>@xmpp</span><span class='period'>.</span><span class='id tell'>tell</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>^_^@jabber.org</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>You'd best be maintaining safubot!</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
167
164
  <span class='kw'>end</span>
168
165
  </pre>
166
+
167
+ <h2><a name="caveats">Caveats</a></h2>
168
+
169
+ <p>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!</p>
169
170
  </div></div>
170
171
 
171
172
  <div id="footer">
172
- Generated on Tue Nov 29 11:44:04 2011 by
173
+ Generated on Thu Dec 1 18:19:17 2011 by
173
174
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
174
175
  0.7.3 (ruby-1.9.2).
175
176
  </div>
data/doc/index.html CHANGED
@@ -71,7 +71,7 @@
71
71
 
72
72
  <h2><a name="documentation">Documentation</a></h2>
73
73
 
74
- <p><a href="http://rdoc.info/gems/safubot">http://rdoc.info/gems/safubot</a></p>
74
+ <p><a href="http://rdoc.info/gems/safubot/frames">http://rdoc.info/gems/safubot/frames</a></p>
75
75
 
76
76
  <h2><a name="example">Sample Usage</a></h2>
77
77
 
@@ -83,10 +83,7 @@
83
83
  </span> <span class='comment'># to do something more sophisticated than an authless localhost connection.
84
84
  </span> <span class='kw'>super</span><span class='lparen'>(</span><span class='symbol'>:database</span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>niftybot</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
85
85
 
86
- <span class='comment'># To access the underlying delegation targets:
87
- </span> <span class='comment'># Safubot::Twitter::Bot bot.twitter
88
- </span> <span class='comment'># ::Twitter::Client bot.twitter.client
89
- </span> <span class='comment'># ::TweetStream::Client bot.twitter.stream
86
+ <span class='comment'># This creates a Safubot::Twitter::Bot instance at @twitter
90
87
  </span> <span class='id enable_twitter'>enable_twitter</span><span class='lparen'>(</span><span class='lbrace'>{</span>
91
88
  <span class='symbol'>:username</span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>niftybot</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span>
92
89
  <span class='symbol'>:consumer_key</span> <span class='op'>=&gt;</span> <span class='const'>CONSUMER_KEY</span><span class='comma'>,</span>
@@ -95,9 +92,7 @@
95
92
  <span class='symbol'>:oauth_token_secret</span> <span class='op'>=&gt;</span> <span class='const'>OAUTH_TOKEN_SECRET</span>
96
93
  <span class='rbrace'>}</span><span class='rparen'>)</span>
97
94
 
98
- <span class='comment'># Similarly, for XMPP:
99
- </span> <span class='comment'># Safubot::XMPP::Bot bot.xmpp
100
- </span> <span class='comment'># ::Blather::Client bot.xmpp.client
95
+ <span class='comment'># Similarly, this makes a Safubot::XMPP::Bot instance at @xmpp
101
96
  </span> <span class='id enable_xmpp'>enable_xmpp</span><span class='lparen'>(</span><span class='lbrace'>{</span>
102
97
  <span class='symbol'>:jid</span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>niftybot@jabber.org/niftyhost</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span>
103
98
  <span class='symbol'>:password</span> <span class='op'>=&gt;</span> <span class='const'>JABBER_PASSWORD</span>
@@ -148,7 +143,9 @@
148
143
 
149
144
  <h3>Update our twitter account</h3>
150
145
 
151
- <pre class="code"><span class='ivar'>@twitter</span><span class='period'>.</span><span class='id client'>client</span><span class='period'>.</span><span class='id update'>update</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Hello there, wonderful, scary world of Twitter! I am so *not* a spambot.</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
146
+ <pre class="code"><span class='ivar'>@twitter</span><span class='period'>.</span><span class='id on'>on</span><span class='lparen'>(</span><span class='symbol'>:ready</span><span class='rparen'>)</span> <span class='kw'>do</span>
147
+ <span class='ivar'>@twitter</span><span class='period'>.</span><span class='id client'>client</span><span class='period'>.</span><span class='id update'>update</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Hello there, wonderful scary world of Twitter! I am so *not* a spambot.</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
148
+ <span class='kw'>end</span>
152
149
  </pre>
153
150
 
154
151
  <h3>Reply to a non-request timeline tweet</h3>
@@ -166,10 +163,14 @@
166
163
  <span class='ivar'>@xmpp</span><span class='period'>.</span><span class='id tell'>tell</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>^_^@jabber.org</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>You'd best be maintaining safubot!</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
167
164
  <span class='kw'>end</span>
168
165
  </pre>
166
+
167
+ <h2><a name="caveats">Caveats</a></h2>
168
+
169
+ <p>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!</p>
169
170
  </div></div>
170
171
 
171
172
  <div id="footer">
172
- Generated on Tue Nov 29 11:44:04 2011 by
173
+ Generated on Thu Dec 1 18:19:17 2011 by
173
174
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
174
175
  0.7.3 (ruby-1.9.2).
175
176
  </div>