pupil 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +12 -0
- data/README.md +113 -0
- data/Rakefile +1 -0
- data/VERSION +1 -1
- data/doc/Pupil.html +212 -216
- data/doc/Pupil/DirectMessage.html +22 -22
- data/doc/Pupil/Entities.html +10 -10
- data/doc/Pupil/Hashtag.html +9 -9
- data/doc/Pupil/Keygen.html +44 -44
- data/doc/Pupil/Keygen/MissingRequiredTokens.html +3 -3
- data/doc/Pupil/List.html +26 -26
- data/doc/Pupil/NetworkError.html +3 -3
- data/doc/Pupil/Status.html +46 -42
- data/doc/Pupil/Stream.html +227 -48
- data/doc/Pupil/Stream/Shash.html +390 -0
- data/doc/Pupil/Stream/Status.html +377 -0
- data/doc/Pupil/Stream/StreamError.html +3 -3
- data/doc/Pupil/URL.html +11 -11
- data/doc/Pupil/UnsupportedParameter.html +3 -3
- data/doc/Pupil/User.html +82 -82
- data/doc/_index.html +17 -10
- data/doc/class_list.html +1 -1
- data/doc/css/style.css +10 -10
- data/doc/file.LICENSE.html +4 -23
- data/doc/file.README.html +117 -46
- data/doc/frames.html +1 -1
- data/doc/index.html +117 -46
- data/doc/js/app.js +4 -4
- data/doc/method_list.html +178 -138
- data/doc/top-level-namespace.html +3 -3
- data/lib/pupil/base.rb +0 -2
- data/lib/pupil/stream/base.rb +47 -23
- data/pupil.gemspec +114 -0
- metadata +25 -27
- data/.document +0 -5
- data/.rspec +0 -1
- data/README.rdoc +0 -19
- data/doc/Pupil/Stream/StreamEvent.html +0 -421
data/doc/_index.html
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
<head>
|
5
5
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
6
6
|
<title>
|
7
|
-
Documentation by YARD 0.7.
|
7
|
+
Documentation by YARD 0.7.4
|
8
8
|
|
9
9
|
</title>
|
10
10
|
|
@@ -52,7 +52,7 @@
|
|
52
52
|
|
53
53
|
<iframe id="search_frame"></iframe>
|
54
54
|
|
55
|
-
<div id="content"><h1 class="noborder title">Documentation by YARD 0.7.
|
55
|
+
<div id="content"><h1 class="noborder title">Documentation by YARD 0.7.4</h1>
|
56
56
|
<div id="listing">
|
57
57
|
<h1 class="alphaindex">Alphabetic Index</h1>
|
58
58
|
|
@@ -205,28 +205,35 @@
|
|
205
205
|
<ul>
|
206
206
|
|
207
207
|
<li>
|
208
|
-
<span class='object_link'><a href="Pupil/
|
208
|
+
<span class='object_link'><a href="Pupil/Stream/Shash.html" title="Pupil::Stream::Shash (class)">Shash</a></span>
|
209
209
|
|
210
|
-
<small>(Pupil)</small>
|
210
|
+
<small>(Pupil::Stream)</small>
|
211
211
|
|
212
212
|
</li>
|
213
213
|
|
214
214
|
<li>
|
215
|
-
<span class='object_link'><a href="Pupil/Stream.html" title="Pupil::Stream (class)">
|
215
|
+
<span class='object_link'><a href="Pupil/Stream/Status.html" title="Pupil::Stream::Status (class)">Status</a></span>
|
216
|
+
|
217
|
+
<small>(Pupil::Stream)</small>
|
218
|
+
|
219
|
+
</li>
|
220
|
+
|
221
|
+
<li>
|
222
|
+
<span class='object_link'><a href="Pupil/Status.html" title="Pupil::Status (class)">Status</a></span>
|
216
223
|
|
217
224
|
<small>(Pupil)</small>
|
218
225
|
|
219
226
|
</li>
|
220
227
|
|
221
228
|
<li>
|
222
|
-
<span class='object_link'><a href="Pupil/Stream
|
229
|
+
<span class='object_link'><a href="Pupil/Stream.html" title="Pupil::Stream (class)">Stream</a></span>
|
223
230
|
|
224
|
-
<small>(Pupil
|
231
|
+
<small>(Pupil)</small>
|
225
232
|
|
226
233
|
</li>
|
227
234
|
|
228
235
|
<li>
|
229
|
-
<span class='object_link'><a href="Pupil/Stream/
|
236
|
+
<span class='object_link'><a href="Pupil/Stream/StreamError.html" title="Pupil::Stream::StreamError (class)">StreamError</a></span>
|
230
237
|
|
231
238
|
<small>(Pupil::Stream)</small>
|
232
239
|
|
@@ -273,9 +280,9 @@
|
|
273
280
|
</div>
|
274
281
|
|
275
282
|
<div id="footer">
|
276
|
-
Generated on
|
283
|
+
Generated on Sat Dec 17 20:58:32 2011 by
|
277
284
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
278
|
-
0.7.
|
285
|
+
0.7.4 (ruby-1.9.2).
|
279
286
|
</div>
|
280
287
|
|
281
288
|
</body>
|
data/doc/class_list.html
CHANGED
@@ -39,7 +39,7 @@
|
|
39
39
|
|
40
40
|
<ul id="full_list" class="class">
|
41
41
|
<li><span class='object_link'><a href="top-level-namespace.html" title=" (root)">Top Level Namespace</a></span></li>
|
42
|
-
<li><a class='toggle'></a> <span class='object_link'><a href="Pupil.html" title="Pupil (class)">Pupil</a></span> < Object<small class='search_info'>Top Level Namespace</small></li><ul><li><span class='object_link'><a href="Pupil/DirectMessage.html" title="Pupil::DirectMessage (class)">DirectMessage</a></span> < Object<small class='search_info'>Pupil</small></li><li><span class='object_link'><a href="Pupil/Entities.html" title="Pupil::Entities (class)">Entities</a></span> < Object<small class='search_info'>Pupil</small></li><li><span class='object_link'><a href="Pupil/Hashtag.html" title="Pupil::Hashtag (class)">Hashtag</a></span> < Object<small class='search_info'>Pupil</small></li><li><a class='toggle'></a> <span class='object_link'><a href="Pupil/Keygen.html" title="Pupil::Keygen (class)">Keygen</a></span> < Object<small class='search_info'>Pupil</small></li><ul><li><span class='object_link'><a href="Pupil/Keygen/MissingRequiredTokens.html" title="Pupil::Keygen::MissingRequiredTokens (class)">MissingRequiredTokens</a></span> < StandardError<small class='search_info'>Pupil::Keygen</small></li></ul><li><span class='object_link'><a href="Pupil/List.html" title="Pupil::List (class)">List</a></span> < Object<small class='search_info'>Pupil</small></li><li><span class='object_link'><a href="Pupil/NetworkError.html" title="Pupil::NetworkError (class)">NetworkError</a></span> < StandardError<small class='search_info'>Pupil</small></li><li><span class='object_link'><a href="Pupil/Status.html" title="Pupil::Status (class)">Status</a></span> < Object<small class='search_info'>Pupil</small></li><li><a class='toggle'></a> <span class='object_link'><a href="Pupil/Stream.html" title="Pupil::Stream (class)">Stream</a></span> < Object<small class='search_info'>Pupil</small></li><ul><li><span class='object_link'><a href="Pupil/Stream/
|
42
|
+
<li><a class='toggle'></a> <span class='object_link'><a href="Pupil.html" title="Pupil (class)">Pupil</a></span> < Object<small class='search_info'>Top Level Namespace</small></li><ul><li><span class='object_link'><a href="Pupil/DirectMessage.html" title="Pupil::DirectMessage (class)">DirectMessage</a></span> < Object<small class='search_info'>Pupil</small></li><li><span class='object_link'><a href="Pupil/Entities.html" title="Pupil::Entities (class)">Entities</a></span> < Object<small class='search_info'>Pupil</small></li><li><span class='object_link'><a href="Pupil/Hashtag.html" title="Pupil::Hashtag (class)">Hashtag</a></span> < Object<small class='search_info'>Pupil</small></li><li><a class='toggle'></a> <span class='object_link'><a href="Pupil/Keygen.html" title="Pupil::Keygen (class)">Keygen</a></span> < Object<small class='search_info'>Pupil</small></li><ul><li><span class='object_link'><a href="Pupil/Keygen/MissingRequiredTokens.html" title="Pupil::Keygen::MissingRequiredTokens (class)">MissingRequiredTokens</a></span> < StandardError<small class='search_info'>Pupil::Keygen</small></li></ul><li><span class='object_link'><a href="Pupil/List.html" title="Pupil::List (class)">List</a></span> < Object<small class='search_info'>Pupil</small></li><li><span class='object_link'><a href="Pupil/NetworkError.html" title="Pupil::NetworkError (class)">NetworkError</a></span> < StandardError<small class='search_info'>Pupil</small></li><li><span class='object_link'><a href="Pupil/Status.html" title="Pupil::Status (class)">Status</a></span> < Object<small class='search_info'>Pupil</small></li><li><a class='toggle'></a> <span class='object_link'><a href="Pupil/Stream.html" title="Pupil::Stream (class)">Stream</a></span> < Object<small class='search_info'>Pupil</small></li><ul><li><span class='object_link'><a href="Pupil/Stream/Shash.html" title="Pupil::Stream::Shash (class)">Shash</a></span> < Object<small class='search_info'>Pupil::Stream</small></li><li><span class='object_link'><a href="Pupil/Stream/Status.html" title="Pupil::Stream::Status (class)">Status</a></span> < Status<small class='search_info'>Pupil::Stream</small></li><li><span class='object_link'><a href="Pupil/Stream/StreamError.html" title="Pupil::Stream::StreamError (class)">StreamError</a></span> < StandardError<small class='search_info'>Pupil::Stream</small></li></ul><li><span class='object_link'><a href="Pupil/URL.html" title="Pupil::URL (class)">URL</a></span> < Object<small class='search_info'>Pupil</small></li><li><span class='object_link'><a href="Pupil/UnsupportedParameter.html" title="Pupil::UnsupportedParameter (class)">UnsupportedParameter</a></span> < StandardError<small class='search_info'>Pupil</small></li><li><span class='object_link'><a href="Pupil/User.html" title="Pupil::User (class)">User</a></span> < Object<small class='search_info'>Pupil</small></li></ul>
|
43
43
|
|
44
44
|
</ul>
|
45
45
|
</div>
|
data/doc/css/style.css
CHANGED
@@ -163,7 +163,7 @@ p.signature .aliases .names { font-family: Monaco, Consolas, Courier, monospace;
|
|
163
163
|
|
164
164
|
#content a:link, #content a:visited { text-decoration: none; color: #05a; }
|
165
165
|
#content a:hover { background: #ffffa5; }
|
166
|
-
.docstring { margin-right: 6em; }
|
166
|
+
div.docstring, p.docstring { margin-right: 6em; }
|
167
167
|
|
168
168
|
ul.summary {
|
169
169
|
list-style: none;
|
@@ -294,7 +294,7 @@ li.r2 { background: #fafafa; }
|
|
294
294
|
#filecontents pre.code, .docstring pre.code { display: block; }
|
295
295
|
.source_code .lines { padding-right: 12px; color: #555; text-align: right; }
|
296
296
|
#filecontents pre.code, .docstring pre.code,
|
297
|
-
.tags .example { padding: 5px 12px; margin-top: 4px; border: 1px solid #eef; background: #f5f5ff; }
|
297
|
+
.tags pre.example { padding: 5px 12px; margin-top: 4px; border: 1px solid #eef; background: #f5f5ff; }
|
298
298
|
pre.code { color: #000; }
|
299
299
|
pre.code .info.file { color: #555; }
|
300
300
|
pre.code .val { color: #036A07; }
|
@@ -302,21 +302,21 @@ pre.code .tstring_content,
|
|
302
302
|
pre.code .heredoc_beg, pre.code .heredoc_end,
|
303
303
|
pre.code .qwords_beg, pre.code .qwords_end,
|
304
304
|
pre.code .tstring, pre.code .dstring { color: #036A07; }
|
305
|
-
pre.code .fid, pre.code .
|
306
|
-
pre.code .
|
305
|
+
pre.code .fid, pre.code .rubyid_new, pre.code .rubyid_to_s,
|
306
|
+
pre.code .rubyid_to_sym, pre.code .rubyid_to_f,
|
307
307
|
pre.code .dot + pre.code .id,
|
308
|
-
pre.code .
|
308
|
+
pre.code .rubyid_to_i pre.code .rubyid_each { color: #0085FF; }
|
309
309
|
pre.code .comment { color: #0066FF; }
|
310
310
|
pre.code .const, pre.code .constant { color: #585CF6; }
|
311
311
|
pre.code .symbol { color: #C5060B; }
|
312
312
|
pre.code .kw,
|
313
313
|
pre.code .label,
|
314
|
-
pre.code .
|
315
|
-
pre.code .
|
316
|
-
pre.code .
|
314
|
+
pre.code .rubyid_require,
|
315
|
+
pre.code .rubyid_extend,
|
316
|
+
pre.code .rubyid_include { color: #0000FF; }
|
317
317
|
pre.code .ivar { color: #318495; }
|
318
318
|
pre.code .gvar,
|
319
|
-
pre.code .
|
320
|
-
pre.code .
|
319
|
+
pre.code .rubyid_backref,
|
320
|
+
pre.code .rubyid_nth_ref { color: #6D79DE; }
|
321
321
|
pre.code .regexp, .dregexp { color: #036A07; }
|
322
322
|
pre.code a { border-bottom: 1px dotted #bbf; }
|
data/doc/file.LICENSE.html
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
<title>
|
7
7
|
File: LICENSE
|
8
8
|
|
9
|
-
— Documentation by YARD 0.7.
|
9
|
+
— Documentation by YARD 0.7.4
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
@@ -54,31 +54,12 @@
|
|
54
54
|
|
55
55
|
<iframe id="search_frame"></iframe>
|
56
56
|
|
57
|
-
<div id="content"><div id='filecontents'
|
58
|
-
|
59
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
60
|
-
a copy of this software and associated documentation files (the
|
61
|
-
"Software"), to deal in the Software without restriction, including
|
62
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
63
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
64
|
-
permit persons to whom the Software is furnished to do so, subject to
|
65
|
-
the following conditions:
|
66
|
-
|
67
|
-
The above copyright notice and this permission notice shall be
|
68
|
-
included in all copies or substantial portions of the Software.
|
69
|
-
|
70
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
71
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
72
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
73
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
74
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
75
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
76
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</pre></div></div>
|
57
|
+
<div id="content"><div id='filecontents'>Copyright (c) 2011 Oame<br/><br/>Permission is hereby granted, free of charge, to any person obtaining<br/>a copy of this software and associated documentation files (the<br/>"Software"), to deal in the Software without restriction, including<br/>without limitation the rights to use, copy, modify, merge, publish,<br/>distribute, sublicense, and/or sell copies of the Software, and to<br/>permit persons to whom the Software is furnished to do so, subject to<br/>the following conditions:<br/><br/>The above copyright notice and this permission notice shall be<br/>included in all copies or substantial portions of the Software.<br/><br/>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,<br/>EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF<br/>MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND<br/>NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE<br/>LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION<br/>OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION<br/>WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</div></div>
|
77
58
|
|
78
59
|
<div id="footer">
|
79
|
-
Generated on
|
60
|
+
Generated on Sat Dec 17 20:58:32 2011 by
|
80
61
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
81
|
-
0.7.
|
62
|
+
0.7.4 (ruby-1.9.2).
|
82
63
|
</div>
|
83
64
|
|
84
65
|
</body>
|
data/doc/file.README.html
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
<title>
|
7
7
|
File: README
|
8
8
|
|
9
|
-
— Documentation by YARD 0.7.
|
9
|
+
— Documentation by YARD 0.7.4
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
@@ -55,58 +55,129 @@
|
|
55
55
|
<iframe id="search_frame"></iframe>
|
56
56
|
|
57
57
|
<div id="content"><div id='filecontents'><h1>pupil</h1>
|
58
|
-
|
59
|
-
Pupil is
|
60
|
-
|
61
|
-
|
62
|
-
<
|
63
|
-
|
58
|
+
|
59
|
+
<p>Pupil is "Lazy" Twitter API Library for Ruby 1.9.x.
|
60
|
+
Easy to use.</p>
|
61
|
+
|
62
|
+
<h2>Features / Problems</h2>
|
63
|
+
|
64
|
+
<ul>
|
65
|
+
<li>Almost Twitter REST API are wrapped. However, some API does not support yet.</li>
|
66
|
+
<li>Twitter Streaming API are supported experimentally.</li>
|
67
|
+
<li>Intuitive syntax.</li>
|
68
|
+
</ul>
|
69
|
+
|
70
|
+
|
71
|
+
<h2>Requirement</h2>
|
72
|
+
|
73
|
+
<ul>
|
74
|
+
<li>json and oauth gem</li>
|
75
|
+
<li>Ruby 1.9.x</li>
|
76
|
+
</ul>
|
77
|
+
|
78
|
+
|
79
|
+
<h2>Installation</h2>
|
80
|
+
|
81
|
+
<pre class="code"><span class='id identifier rubyid_gem'>gem</span> <span class='id identifier rubyid_install'>install</span> <span class='id identifier rubyid_pupil'>pupil</span>
|
82
|
+
</pre>
|
83
|
+
|
84
|
+
<h2>Examples</h2>
|
85
|
+
|
86
|
+
<pre class="code"><span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>pupil</span><span class='tstring_end'>"</span></span>
|
87
|
+
|
88
|
+
<span class='const'>CONSUMER</span> <span class='op'>=</span> <span class='lbrace'>{</span>
|
89
|
+
<span class='symbol'>:app_name</span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Web Service</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='comment'># Optional
|
90
|
+
</span> <span class='symbol'>:app_author</span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>o_ame</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='comment'># Optional
|
91
|
+
</span> <span class='symbol'>:consumer_key</span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>something</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='comment'># Required
|
92
|
+
</span> <span class='symbol'>:consumer_secret</span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>something</span><span class='tstring_end'>"</span></span> <span class='comment'># Required
|
93
|
+
</span><span class='rbrace'>}</span>
|
94
|
+
|
95
|
+
<span class='id identifier rubyid_pupil_key'>pupil_key</span> <span class='op'>=</span> <span class='lbrace'>{</span>
|
96
|
+
<span class='symbol'>:screen_name</span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>o_ame</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='comment'># Required
|
97
|
+
</span> <span class='symbol'>:access_token</span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>something</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='comment'># Required
|
98
|
+
</span> <span class='symbol'>:access_token_secret</span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>something</span><span class='tstring_end'>"</span></span> <span class='comment'># Required
|
99
|
+
</span><span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_update'>update</span> <span class='const'>CONSUMER</span>
|
100
|
+
|
101
|
+
<span class='id identifier rubyid_pupil'>pupil</span> <span class='op'>=</span> <span class='const'>Pupil</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='id identifier rubyid_pupil_key'>pupil_key</span>
|
102
|
+
|
103
|
+
<span class='comment'># Get timeline statuses without replies
|
104
|
+
</span><span class='id identifier rubyid_pupil'>pupil</span><span class='period'>.</span><span class='id identifier rubyid_home_timeline'>home_timeline</span> <span class='symbol'>:count</span> <span class='op'>=></span> <span class='int'>50</span><span class='comma'>,</span> <span class='symbol'>:exclude</span> <span class='op'>=></span> <span class='symbol'>:replies</span>
|
105
|
+
|
106
|
+
<span class='comment'># Follow User
|
107
|
+
</span><span class='id identifier rubyid_pupil'>pupil</span><span class='period'>.</span><span class='id identifier rubyid_follow'>follow</span> <span class='symbol'>:screen_name</span> <span class='op'>=></span> <span class='symbol'>:twitterapi</span>
|
108
|
+
|
109
|
+
<span class='comment'># Update URL on profile
|
110
|
+
</span><span class='id identifier rubyid_pupil'>pupil</span><span class='period'>.</span><span class='id identifier rubyid_update_profile'>update_profile</span> <span class='symbol'>:url</span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>http://oameya.com</span><span class='tstring_end'>"</span></span>
|
64
111
|
</pre>
|
112
|
+
|
113
|
+
<p>Using Streaming API</p>
|
114
|
+
|
115
|
+
<pre class="code">require "pupil/stream"
|
116
|
+
|
117
|
+
CONSUMER = {
|
118
|
+
:app_name => "Web Service",
|
119
|
+
:app_author => "o_ame",
|
120
|
+
:consumer_key => "something",
|
121
|
+
:consumer_secret => "something"
|
122
|
+
}
|
123
|
+
|
124
|
+
pupil_key = {
|
125
|
+
:screen_name => "o_ame",
|
126
|
+
:access_token => "something",
|
127
|
+
:access_token_secret => "something"
|
128
|
+
}.update CONSUMER
|
129
|
+
|
130
|
+
stream = Pupil::Stream.new pupil_key
|
131
|
+
|
132
|
+
# Userstream
|
133
|
+
stream.start :userstream do |status|
|
134
|
+
puts status.type #=> Show type of status
|
135
|
+
if status.type == :retweeted
|
136
|
+
puts "#{status.content['user']['screen_name']: #{status.content['text']}"
|
137
|
+
end
|
138
|
+
end
|
139
|
+
|
140
|
+
# Search stream
|
141
|
+
stream.start :filter, :track => "#MerryChristmas" do |status|
|
142
|
+
puts "#{status['user']['screen_name']: #{status['text']}"
|
143
|
+
end
|
144
|
+
</pre>
|
145
|
+
|
146
|
+
<p>Making <code>pupil_key</code></p>
|
147
|
+
|
148
|
+
<pre class="code"><span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>pupil/keygen</span><span class='tstring_end'>"</span></span>
|
149
|
+
|
150
|
+
<span class='id identifier rubyid_keygen'>keygen</span> <span class='op'>=</span> <span class='const'>Pupil</span><span class='op'>::</span><span class='const'>Keygen</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
151
|
+
<span class='id identifier rubyid_keygen'>keygen</span><span class='period'>.</span><span class='id identifier rubyid_interactive'>interactive</span> <span class='comment'>#=> Generate pupil_key interactively
|
152
|
+
</span></pre>
|
153
|
+
|
154
|
+
<h2>Contributing to pupil</h2>
|
155
|
+
|
65
156
|
<ul>
|
66
|
-
<li
|
67
|
-
Check out the
|
68
|
-
|
69
|
-
</
|
70
|
-
</li>
|
71
|
-
<li
|
72
|
-
|
73
|
-
requested it and/or contributed it
|
74
|
-
</p>
|
75
|
-
</li>
|
76
|
-
<li><p>
|
77
|
-
Fork the project
|
78
|
-
</p>
|
79
|
-
</li>
|
80
|
-
<li><p>
|
81
|
-
Start a feature/bugfix branch
|
82
|
-
</p>
|
83
|
-
</li>
|
84
|
-
<li><p>
|
85
|
-
Commit and push until you are happy with your contribution
|
86
|
-
</p>
|
87
|
-
</li>
|
88
|
-
<li><p>
|
89
|
-
Make sure to add tests for it. This is important so I don’t break it
|
90
|
-
in a future version unintentionally.
|
91
|
-
</p>
|
92
|
-
</li>
|
93
|
-
<li><p>
|
94
|
-
Please try not to mess with the Rakefile, version, or history. If you want
|
95
|
-
to have your own version, or is otherwise necessary, that is fine, but
|
96
|
-
please isolate to its own commit so I can cherry-pick around it.
|
97
|
-
</p>
|
98
|
-
</li>
|
157
|
+
<li>Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet</li>
|
158
|
+
<li>Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it</li>
|
159
|
+
<li>Fork the project</li>
|
160
|
+
<li>Start a feature/bugfix branch</li>
|
161
|
+
<li>Commit and push until you are happy with your contribution</li>
|
162
|
+
<li>Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.</li>
|
163
|
+
<li>Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.</li>
|
99
164
|
</ul>
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
165
|
+
|
166
|
+
|
167
|
+
<h2>Credits</h2>
|
168
|
+
|
169
|
+
<p>Developer: <a href="http://twitter.com/o_ame">Oame</a></p>
|
170
|
+
|
171
|
+
<h2>License</h2>
|
172
|
+
|
173
|
+
<p>Copyright (c) 2011 Oame. See LICENSE.txt for
|
174
|
+
further details.</p>
|
104
175
|
</div></div>
|
105
176
|
|
106
177
|
<div id="footer">
|
107
|
-
Generated on
|
178
|
+
Generated on Sat Dec 17 20:58:32 2011 by
|
108
179
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
109
|
-
0.7.
|
180
|
+
0.7.4 (ruby-1.9.2).
|
110
181
|
</div>
|
111
182
|
|
112
183
|
</body>
|
data/doc/frames.html
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
5
5
|
<head>
|
6
6
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
7
|
-
<title>Documentation by YARD 0.7.
|
7
|
+
<title>Documentation by YARD 0.7.4</title>
|
8
8
|
</head>
|
9
9
|
<frameset cols="20%,*">
|
10
10
|
<frame name="list" src="class_list.html" />
|
data/doc/index.html
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
<title>
|
7
7
|
File: README
|
8
8
|
|
9
|
-
— Documentation by YARD 0.7.
|
9
|
+
— Documentation by YARD 0.7.4
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
@@ -55,58 +55,129 @@
|
|
55
55
|
<iframe id="search_frame"></iframe>
|
56
56
|
|
57
57
|
<div id="content"><div id='filecontents'><h1>pupil</h1>
|
58
|
-
|
59
|
-
Pupil is
|
60
|
-
|
61
|
-
|
62
|
-
<
|
63
|
-
|
58
|
+
|
59
|
+
<p>Pupil is "Lazy" Twitter API Library for Ruby 1.9.x.
|
60
|
+
Easy to use.</p>
|
61
|
+
|
62
|
+
<h2>Features / Problems</h2>
|
63
|
+
|
64
|
+
<ul>
|
65
|
+
<li>Almost Twitter REST API are wrapped. However, some API does not support yet.</li>
|
66
|
+
<li>Twitter Streaming API are supported experimentally.</li>
|
67
|
+
<li>Intuitive syntax.</li>
|
68
|
+
</ul>
|
69
|
+
|
70
|
+
|
71
|
+
<h2>Requirement</h2>
|
72
|
+
|
73
|
+
<ul>
|
74
|
+
<li>json and oauth gem</li>
|
75
|
+
<li>Ruby 1.9.x</li>
|
76
|
+
</ul>
|
77
|
+
|
78
|
+
|
79
|
+
<h2>Installation</h2>
|
80
|
+
|
81
|
+
<pre class="code"><span class='id identifier rubyid_gem'>gem</span> <span class='id identifier rubyid_install'>install</span> <span class='id identifier rubyid_pupil'>pupil</span>
|
82
|
+
</pre>
|
83
|
+
|
84
|
+
<h2>Examples</h2>
|
85
|
+
|
86
|
+
<pre class="code"><span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>pupil</span><span class='tstring_end'>"</span></span>
|
87
|
+
|
88
|
+
<span class='const'>CONSUMER</span> <span class='op'>=</span> <span class='lbrace'>{</span>
|
89
|
+
<span class='symbol'>:app_name</span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Web Service</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='comment'># Optional
|
90
|
+
</span> <span class='symbol'>:app_author</span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>o_ame</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='comment'># Optional
|
91
|
+
</span> <span class='symbol'>:consumer_key</span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>something</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='comment'># Required
|
92
|
+
</span> <span class='symbol'>:consumer_secret</span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>something</span><span class='tstring_end'>"</span></span> <span class='comment'># Required
|
93
|
+
</span><span class='rbrace'>}</span>
|
94
|
+
|
95
|
+
<span class='id identifier rubyid_pupil_key'>pupil_key</span> <span class='op'>=</span> <span class='lbrace'>{</span>
|
96
|
+
<span class='symbol'>:screen_name</span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>o_ame</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='comment'># Required
|
97
|
+
</span> <span class='symbol'>:access_token</span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>something</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='comment'># Required
|
98
|
+
</span> <span class='symbol'>:access_token_secret</span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>something</span><span class='tstring_end'>"</span></span> <span class='comment'># Required
|
99
|
+
</span><span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_update'>update</span> <span class='const'>CONSUMER</span>
|
100
|
+
|
101
|
+
<span class='id identifier rubyid_pupil'>pupil</span> <span class='op'>=</span> <span class='const'>Pupil</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='id identifier rubyid_pupil_key'>pupil_key</span>
|
102
|
+
|
103
|
+
<span class='comment'># Get timeline statuses without replies
|
104
|
+
</span><span class='id identifier rubyid_pupil'>pupil</span><span class='period'>.</span><span class='id identifier rubyid_home_timeline'>home_timeline</span> <span class='symbol'>:count</span> <span class='op'>=></span> <span class='int'>50</span><span class='comma'>,</span> <span class='symbol'>:exclude</span> <span class='op'>=></span> <span class='symbol'>:replies</span>
|
105
|
+
|
106
|
+
<span class='comment'># Follow User
|
107
|
+
</span><span class='id identifier rubyid_pupil'>pupil</span><span class='period'>.</span><span class='id identifier rubyid_follow'>follow</span> <span class='symbol'>:screen_name</span> <span class='op'>=></span> <span class='symbol'>:twitterapi</span>
|
108
|
+
|
109
|
+
<span class='comment'># Update URL on profile
|
110
|
+
</span><span class='id identifier rubyid_pupil'>pupil</span><span class='period'>.</span><span class='id identifier rubyid_update_profile'>update_profile</span> <span class='symbol'>:url</span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>http://oameya.com</span><span class='tstring_end'>"</span></span>
|
64
111
|
</pre>
|
112
|
+
|
113
|
+
<p>Using Streaming API</p>
|
114
|
+
|
115
|
+
<pre class="code">require "pupil/stream"
|
116
|
+
|
117
|
+
CONSUMER = {
|
118
|
+
:app_name => "Web Service",
|
119
|
+
:app_author => "o_ame",
|
120
|
+
:consumer_key => "something",
|
121
|
+
:consumer_secret => "something"
|
122
|
+
}
|
123
|
+
|
124
|
+
pupil_key = {
|
125
|
+
:screen_name => "o_ame",
|
126
|
+
:access_token => "something",
|
127
|
+
:access_token_secret => "something"
|
128
|
+
}.update CONSUMER
|
129
|
+
|
130
|
+
stream = Pupil::Stream.new pupil_key
|
131
|
+
|
132
|
+
# Userstream
|
133
|
+
stream.start :userstream do |status|
|
134
|
+
puts status.type #=> Show type of status
|
135
|
+
if status.type == :retweeted
|
136
|
+
puts "#{status.content['user']['screen_name']: #{status.content['text']}"
|
137
|
+
end
|
138
|
+
end
|
139
|
+
|
140
|
+
# Search stream
|
141
|
+
stream.start :filter, :track => "#MerryChristmas" do |status|
|
142
|
+
puts "#{status['user']['screen_name']: #{status['text']}"
|
143
|
+
end
|
144
|
+
</pre>
|
145
|
+
|
146
|
+
<p>Making <code>pupil_key</code></p>
|
147
|
+
|
148
|
+
<pre class="code"><span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>pupil/keygen</span><span class='tstring_end'>"</span></span>
|
149
|
+
|
150
|
+
<span class='id identifier rubyid_keygen'>keygen</span> <span class='op'>=</span> <span class='const'>Pupil</span><span class='op'>::</span><span class='const'>Keygen</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
151
|
+
<span class='id identifier rubyid_keygen'>keygen</span><span class='period'>.</span><span class='id identifier rubyid_interactive'>interactive</span> <span class='comment'>#=> Generate pupil_key interactively
|
152
|
+
</span></pre>
|
153
|
+
|
154
|
+
<h2>Contributing to pupil</h2>
|
155
|
+
|
65
156
|
<ul>
|
66
|
-
<li
|
67
|
-
Check out the
|
68
|
-
|
69
|
-
</
|
70
|
-
</li>
|
71
|
-
<li
|
72
|
-
|
73
|
-
requested it and/or contributed it
|
74
|
-
</p>
|
75
|
-
</li>
|
76
|
-
<li><p>
|
77
|
-
Fork the project
|
78
|
-
</p>
|
79
|
-
</li>
|
80
|
-
<li><p>
|
81
|
-
Start a feature/bugfix branch
|
82
|
-
</p>
|
83
|
-
</li>
|
84
|
-
<li><p>
|
85
|
-
Commit and push until you are happy with your contribution
|
86
|
-
</p>
|
87
|
-
</li>
|
88
|
-
<li><p>
|
89
|
-
Make sure to add tests for it. This is important so I don’t break it
|
90
|
-
in a future version unintentionally.
|
91
|
-
</p>
|
92
|
-
</li>
|
93
|
-
<li><p>
|
94
|
-
Please try not to mess with the Rakefile, version, or history. If you want
|
95
|
-
to have your own version, or is otherwise necessary, that is fine, but
|
96
|
-
please isolate to its own commit so I can cherry-pick around it.
|
97
|
-
</p>
|
98
|
-
</li>
|
157
|
+
<li>Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet</li>
|
158
|
+
<li>Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it</li>
|
159
|
+
<li>Fork the project</li>
|
160
|
+
<li>Start a feature/bugfix branch</li>
|
161
|
+
<li>Commit and push until you are happy with your contribution</li>
|
162
|
+
<li>Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.</li>
|
163
|
+
<li>Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.</li>
|
99
164
|
</ul>
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
165
|
+
|
166
|
+
|
167
|
+
<h2>Credits</h2>
|
168
|
+
|
169
|
+
<p>Developer: <a href="http://twitter.com/o_ame">Oame</a></p>
|
170
|
+
|
171
|
+
<h2>License</h2>
|
172
|
+
|
173
|
+
<p>Copyright (c) 2011 Oame. See LICENSE.txt for
|
174
|
+
further details.</p>
|
104
175
|
</div></div>
|
105
176
|
|
106
177
|
<div id="footer">
|
107
|
-
Generated on
|
178
|
+
Generated on Sat Dec 17 20:58:32 2011 by
|
108
179
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
109
|
-
0.7.
|
180
|
+
0.7.4 (ruby-1.9.2).
|
110
181
|
</div>
|
111
182
|
|
112
183
|
</body>
|