<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta name="Content-Type" content="text/html; charset=utf-8" />
<title>Documentation by YARD 0.5.4</title>
<link rel="stylesheet" href="css/style.css" type="text/css" media="screen" charset="utf-8" />
<link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />
<script type="text/javascript" charset="utf-8">
relpath = '';
if (relpath != '') relpath += '/';
</script>
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
<script type="text/javascript" charset="utf-8" src="js/app.js"></script>
</head>
<body>
<script type="text/javascript" charset="utf-8">
if (window.top.frames.main) document.body.className = 'frames';
</script>
<div id="header">
<div id="menu">
<a href="_index.html" title="Index">Index</a> »
<span class="title">File: README</span>
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
</div>
<div id="search">
<a id="class_list_link" href="#">Class List</a>
<a id="method_list_link" href="#">Method List</a>
<a id ="file_list_link" href="#">File List</a>
</div>
<div class="clear"></div>
</div>
<iframe id="search_frame"></iframe>
<div id="content"><div id='filecontents'><h1 id='shroud'>Shroud</h1>
<p>A ruby wrapper for <a href='http://getcloudapp.com/'>Cloud.app’s</a> <a href='http://support.getcloudapp.com/faqs/developers/api'>REST API</a>.</p>
<p><strong>NB</strong>: If you try to upload an item and wonder why it doesn’t work, it’s because it doesn’t work <em>yet</em>. I am working on it.</p>
<h2 id='example'>Example</h2>
<pre class="code"><span class='id require'>require</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>shroud</span><span class='tstring_end'>'</span></span>
<span class='const'>Shroud</span><span class='period'>.</span><span class='id get_item'>get_item</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>a</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span> <span class='comment'>#=> returns a hash of info on http://cl.ly/a
</span>
<span class='comment'># For every other thing you need to log in
</span>
<span class='id c'>c</span> <span class='op'>=</span> <span class='const'>Shroud</span><span class='op'>::</span><span class='const'>Session</span><span class='period'>.</span><span class='id new'>new</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>my_email</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>my_password</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
<span class='id c'>c</span><span class='period'>.</span><span class='id list_items'>list_items</span><span class='lparen'>(</span><span class='symbol'>:type</span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>image</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span> <span class='comment'>#=> return a list of my recent images
</span>
<span class='id b'>b</span> <span class='op'>=</span> <span class='id c'>c</span><span class='period'>.</span><span class='id create_bookmark'>create_bookmark</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>http://getcloudapp.com/</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>CloudApp</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span> <span class='comment'>#=> Shorten url
</span>
<span class='id c'>c</span><span class='period'>.</span><span class='id delete_item'>delete_item</span><span class='lparen'>(</span><span class='id b'>b</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>slug</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='rparen'>)</span> <span class='comment'>#=> Delete the bookmark you just created
</span>
<span class='comment'># not working atm
</span><span class='id c'>c</span><span class='period'>.</span><span class='id upload_file'>upload_file</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>list.txt</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span> <span class='comment'>#=> uploads 'list.txt'</span></pre>
<h2 id='command_line'>Command Line</h2>
<p>You can use the <code>shroud</code> executable to interact with the REST API from the command line. Type <code>shroud -h</code> to see the list of commands. To add your login details you need to edit your <code>~/.bashrc</code> and add:</p>
<pre class="code"><span class='id export'>export</span> <span class='const'>SHROUD_USER</span><span class='op'>=</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>yourusername</span><span class='tstring_end'>"</span></span>
<span class='id export'>export</span> <span class='const'>SHROUD_PASS</span><span class='op'>=</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>yourpassword</span><span class='tstring_end'>"</span></span></pre>
<h2 id='license'>License</h2>
<p><strong>MIT LICENSE</strong></p>
<p>Copyright (c) 2010 Joshua Hawxwell</p>
<p>Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:</p>
<p>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.</p>
<p>THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p></div></div>
<div id="footer">
Generated on Thu May 13 18:53:17 2010 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool">yard</a>
0.5.4 (ruby-1.9.1).
</div>
</body>
</html>