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/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'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>niftybot</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
85
85
|
|
86
|
-
<span class='comment'>#
|
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'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>niftybot</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
|
92
89
|
<span class='symbol'>:consumer_key</span> <span class='op'>=></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'>=></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,
|
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'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>niftybot@jabber.org/niftyhost</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
|
103
98
|
<span class='symbol'>:password</span> <span class='op'>=></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
|
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'>"</span><span class='tstring_content'>Hello there, wonderful scary world of Twitter! I am so *not* a spambot.</span><span class='tstring_end'>"</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'>"</span><span class='tstring_content'>You'd best be maintaining safubot!</span><span class='tstring_end'>"</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
|
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'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>niftybot</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
85
85
|
|
86
|
-
<span class='comment'>#
|
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'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>niftybot</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
|
92
89
|
<span class='symbol'>:consumer_key</span> <span class='op'>=></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'>=></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,
|
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'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>niftybot@jabber.org/niftyhost</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
|
103
98
|
<span class='symbol'>:password</span> <span class='op'>=></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
|
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'>"</span><span class='tstring_content'>Hello there, wonderful scary world of Twitter! I am so *not* a spambot.</span><span class='tstring_end'>"</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'>"</span><span class='tstring_content'>You'd best be maintaining safubot!</span><span class='tstring_end'>"</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
|
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>
|