doc/index.html in pupil-0.1.1 vs doc/index.html in pupil-0.1.2
- old
+ new
@@ -4,11 +4,11 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>
File: README
- — Documentation by YARD 0.7.3
+ — Documentation by YARD 0.7.4
</title>
<link rel="stylesheet" href="css/style.css" type="text/css" media="screen" charset="utf-8" />
@@ -53,61 +53,132 @@
</div>
<iframe id="search_frame"></iframe>
<div id="content"><div id='filecontents'><h1>pupil</h1>
-<p>
-Pupil is lazy Twitter API Wrapper for Ruby 1.9.x
-</p>
-<h2>Contributing to pupil</h2>
-<pre class="code">
-
+
+<p>Pupil is "Lazy" Twitter API Library for Ruby 1.9.x.
+Easy to use.</p>
+
+<h2>Features / Problems</h2>
+
+<ul>
+<li>Almost Twitter REST API are wrapped. However, some API does not support yet.</li>
+<li>Twitter Streaming API are supported experimentally.</li>
+<li>Intuitive syntax.</li>
+</ul>
+
+
+<h2>Requirement</h2>
+
+<ul>
+<li>json and oauth gem</li>
+<li>Ruby 1.9.x</li>
+</ul>
+
+
+<h2>Installation</h2>
+
+<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>
</pre>
+
+<h2>Examples</h2>
+
+<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>
+
+<span class='const'>CONSUMER</span> <span class='op'>=</span> <span class='lbrace'>{</span>
+ <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
+</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
+</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
+</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
+</span><span class='rbrace'>}</span>
+
+<span class='id identifier rubyid_pupil_key'>pupil_key</span> <span class='op'>=</span> <span class='lbrace'>{</span>
+ <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
+</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
+</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
+</span><span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_update'>update</span> <span class='const'>CONSUMER</span>
+
+<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>
+
+<span class='comment'># Get timeline statuses without replies
+</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>
+
+<span class='comment'># Follow User
+</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>
+
+<span class='comment'># Update URL on profile
+</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>
+</pre>
+
+<p>Using Streaming API</p>
+
+<pre class="code">require "pupil/stream"
+
+CONSUMER = {
+ :app_name => "Web Service",
+ :app_author => "o_ame",
+ :consumer_key => "something",
+ :consumer_secret => "something"
+}
+
+pupil_key = {
+ :screen_name => "o_ame",
+ :access_token => "something",
+ :access_token_secret => "something"
+}.update CONSUMER
+
+stream = Pupil::Stream.new pupil_key
+
+# Userstream
+stream.start :userstream do |status|
+ puts status.type #=> Show type of status
+ if status.type == :retweeted
+ puts "#{status.content['user']['screen_name']: #{status.content['text']}"
+ end
+end
+
+# Search stream
+stream.start :filter, :track => "#MerryChristmas" do |status|
+ puts "#{status['user']['screen_name']: #{status['text']}"
+end
+</pre>
+
+<p>Making <code>pupil_key</code></p>
+
+<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>
+
+<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>
+<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
+</span></pre>
+
+<h2>Contributing to pupil</h2>
+
<ul>
-<li><p>
-Check out the latest master to make sure the feature hasn’t been
-implemented or the bug hasn’t been fixed yet
-</p>
-</li>
-<li><p>
-Check out the issue tracker to make sure someone already hasn’t
-requested it and/or contributed it
-</p>
-</li>
-<li><p>
-Fork the project
-</p>
-</li>
-<li><p>
-Start a feature/bugfix branch
-</p>
-</li>
-<li><p>
-Commit and push until you are happy with your contribution
-</p>
-</li>
-<li><p>
-Make sure to add tests for it. This is important so I don’t break it
-in a future version unintentionally.
-</p>
-</li>
-<li><p>
-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.
-</p>
-</li>
+<li>Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet</li>
+<li>Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it</li>
+<li>Fork the project</li>
+<li>Start a feature/bugfix branch</li>
+<li>Commit and push until you are happy with your contribution</li>
+<li>Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.</li>
+<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>
</ul>
-<h2>Copyright</h2>
-<p>
-Copyright © 2011 Oame. See LICENSE.txt for further details.
-</p>
+
+
+<h2>Credits</h2>
+
+<p>Developer: <a href="http://twitter.com/o_ame">Oame</a></p>
+
+<h2>License</h2>
+
+<p>Copyright (c) 2011 Oame. See LICENSE.txt for
+further details.</p>
</div></div>
<div id="footer">
- Generated on Fri Dec 16 17:19:17 2011 by
+ Generated on Sat Dec 17 20:58:32 2011 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
- 0.7.3 (ruby-1.9.2).
+ 0.7.4 (ruby-1.9.2).
</div>
</body>
</html>
\ No newline at end of file