This commit is contained in:
Claude 2013-11-10 13:24:54 +01:00
parent 9804cb15ee
commit 7c0ba5ce2e
3 changed files with 99 additions and 71 deletions

View File

@ -9,18 +9,25 @@
<div class="span12"> <div class="span12">
<p class="explain border">Create pastes from the commandline</p> <p class="explain border">Create pastes from the commandline</p>
<h2>API URL</h2> <h2>API URL</h2>
<p class="explain"><code><?php echo site_url('api/create'); ?></code></p> <p class="explain"><code><?php echo site_url('api'); ?></code></p>
<h2>Return values</h2> <h2>Get paste</h2>
<p class="explain"> <p class="explain"><code><?php echo site_url('api/paste/[pasteid]'); ?></code></p>
On success, the API returns the paste URL: <code><?php echo site_url('view/[pasteid]'); ?></code><br />
On error, the API returns the error message: <code>Error: Missing paste text</code>
</p>
<h2>POST parameters</h2> <h2>Get random paste</h2>
<p>&nbsp;</p> <p class="explain"><code><?php echo site_url('api/random'); ?></code></p>
<h2>Get recent pastes</h2>
<p class="explain"><code><?php echo site_url('api/recent'); ?></code></p>
<h2>Get trending pastes</h2>
<p class="explain"><code><?php echo site_url('api/trending'); ?></code></p>
<h2>Create a paste</h2>
<p class="explain"><code><?php echo site_url('api/create'); ?></code></p>
<h3>POST parameters</h3>
<code>text=[your paste text]</code> <code>text=[your paste text]</code>
<p class="explain">The paste content. Required.</p> <p class="explain">The paste content. Required.</p>
@ -45,9 +52,13 @@
<code>reply=[pasteid]</code> <code>reply=[pasteid]</code>
<p class="explain">Reply to existing paste.</p> <p class="explain">Reply to existing paste.</p>
<h2>Examples</h2> <h3>Return values</h3>
<p>&nbsp;</p> <p class="explain">
On success, the API returns the paste URL: <code><?php echo site_url('view/[pasteid]'); ?></code><br />
On error, the API returns the error message: <code>Error: Missing paste text</code>
</p>
<h2>Examples</h2>
<h3>Create paste</h3> <h3>Create paste</h3>
<code>curl -d text='this is my text' <?php echo site_url('api/create'); ?></code> <code>curl -d text='this is my text' <?php echo site_url('api/create'); ?></code>
<p class="explain">Create a paste with the text 'this is my text'.</p> <p class="explain">Create a paste with the text 'this is my text'.</p>

View File

@ -5,17 +5,24 @@
<p class="explain border">Create pastes from the commandline</p> <p class="explain border">Create pastes from the commandline</p>
<h2>API URL</h2> <h2>API URL</h2>
<p class="explain"><code><?php echo site_url('api'); ?></code></p>
<h2>Get paste</h2>
<p class="explain"><code><?php echo site_url('api/paste/[pasteid]'); ?></code></p>
<h2>Get random paste</h2>
<p class="explain"><code><?php echo site_url('api/random'); ?></code></p>
<h2>Get recent pastes</h2>
<p class="explain"><code><?php echo site_url('api/recent'); ?></code></p>
<h2>Get trending pastes</h2>
<p class="explain"><code><?php echo site_url('api/trending'); ?></code></p>
<h2>Create a paste</h2>
<p class="explain"><code><?php echo site_url('api/create'); ?></code></p> <p class="explain"><code><?php echo site_url('api/create'); ?></code></p>
<h2>Return values</h2> <h3>POST parameters</h3>
<p class="explain">
On success, the API returns the paste URL: <code><?php echo site_url('view/[pasteid]'); ?></code><br />
On error, the API returns the error message: <code>Error: Missing paste text</code>
</p>
<h2>POST parameters</h2>
<p>&nbsp;</p>
<code>text=[your paste text]</code> <code>text=[your paste text]</code>
<p class="explain">The paste content. Required.</p> <p class="explain">The paste content. Required.</p>
@ -40,9 +47,13 @@
<code>reply=[pasteid]</code> <code>reply=[pasteid]</code>
<p class="explain">Reply to existing paste.</p> <p class="explain">Reply to existing paste.</p>
<h2>Examples</h2> <h3>Return values</h3>
<p>&nbsp;</p> <p class="explain">
On success, the API returns the paste URL: <code><?php echo site_url('view/[pasteid]'); ?></code><br />
On error, the API returns the error message: <code>Error: Missing paste text</code>
</p>
<h2>Examples</h2>
<h3>Create paste</h3> <h3>Create paste</h3>
<code>curl -d text='this is my text' <?php echo site_url('api/create'); ?></code> <code>curl -d text='this is my text' <?php echo site_url('api/create'); ?></code>
<p class="explain">Create a paste with the text 'this is my text'.</p> <p class="explain">Create a paste with the text 'this is my text'.</p>

View File

@ -1,69 +1,75 @@
<?php $this->load->view("defaults/header");?> <?php $this->load->view("defaults/header");?>
<div class="row"> <div class="api">
<div class="span12"> <h1>API</h1>
<div class="page-header"> <p class="explain border">Create pastes from the commandline</p>
<h1>API</h1>
</div>
</div>
<div class="span12">
<p class="explain border">Create pastes from the commandline</p>
<h2>API URL</h2> <h2>API URL</h2>
<p class="explain"><code><?php echo site_url('api/create'); ?></code></p> <p class="explain"><code><?php echo site_url('api'); ?></code></p>
<h2>Return values</h2> <h2>Get paste</h2>
<p class="explain"> <p class="explain"><code><?php echo site_url('api/paste/[pasteid]'); ?></code></p>
On success, the API returns the paste URL: <code><?php echo site_url('view/[pasteid]'); ?></code><br />
On error, the API returns the error message: <code>Error: Missing paste text</code>
</p>
<h2>POST parameters</h2> <h2>Get random paste</h2>
<p>&nbsp;</p> <p class="explain"><code><?php echo site_url('api/random'); ?></code></p>
<code>text=[your paste text]</code> <h2>Get recent pastes</h2>
<p class="explain">The paste content. Required.</p> <p class="explain"><code><?php echo site_url('api/recent'); ?></code></p>
<code>title=[title]</code> <h2>Get trending pastes</h2>
<p class="explain">Title for the paste.</p> <p class="explain"><code><?php echo site_url('api/trending'); ?></code></p>
<code>name=[name]</code> <h2>Create a paste</h2>
<p class="explain">The author's name.</p> <p class="explain"><code><?php echo site_url('api/create'); ?></code></p>
<code>private=1</code> <h3>POST parameters</h3>
<p class="explain">Make paste private.</p> <code>text=[your paste text]</code>
<p class="explain">The paste content. Required.</p>
<code>lang=[language]</code> <code>title=[title]</code>
<p class="explain"> <p class="explain">Title for the paste.</p>
Use alternative syntax highlighting.<br />
Possible values: <?php echo $languages; ?>
</p>
<code>expire=[minutes]</code> <code>name=[name]</code>
<p class="explain">Set paste expiration.</p> <p class="explain">The author's name.</p>
<code>reply=[pasteid]</code> <code>private=1</code>
<p class="explain">Reply to existing paste.</p> <p class="explain">Make paste private.</p>
<h2>Examples</h2> <code>lang=[language]</code>
<p>&nbsp;</p> <p class="explain">
Use alternative syntax highlighting.<br />
Possible values: <?php echo $languages; ?>
</p>
<h3>Create paste</h3> <code>expire=[minutes]</code>
<code>curl -d text='this is my text' <?php echo site_url('api/create'); ?></code> <p class="explain">Set paste expiration.</p>
<p class="explain">Create a paste with the text 'this is my text'.</p>
<h3>Create paste from a file</h3> <code>reply=[pasteid]</code>
<code>curl -d private=1 -d name=Herbert --data-urlencode text@/etc/passwd <?php echo site_url('api/create'); ?></code> <p class="explain">Reply to existing paste.</p>
<p class="explain">Create a private paste with the author 'Herbert' and the contents of '/etc/passwd'.</p>
<h3>Create paste from a php file</h3> <h3>Return values</h3>
<code>curl -d lang=php --data-urlencode text@main.php <?php echo site_url('api/create'); ?></code> <p class="explain">
<p class="explain">Create a paste with PHP syntax highlighting.</p> On success, the API returns the paste URL: <code><?php echo site_url('view/[pasteid]'); ?></code><br />
On error, the API returns the error message: <code>Error: Missing paste text</code>
</p>
<h2>Examples</h2>
<h3>Create paste</h3>
<code>curl -d text='this is my text' <?php echo site_url('api/create'); ?></code>
<p class="explain">Create a paste with the text 'this is my text'.</p>
<h3>Create paste from a file</h3>
<code>curl -d private=1 -d name=Herbert --data-urlencode text@/etc/passwd <?php echo site_url('api/create'); ?></code>
<p class="explain">Create a private paste with the author 'Herbert' and the contents of '/etc/passwd'.</p>
<h3>Create paste from a php file</h3>
<code>curl -d lang=php --data-urlencode text@main.php <?php echo site_url('api/create'); ?></code>
<p class="explain">Create a paste with PHP syntax highlighting.</p>
<h3>Get paste ;-)</h3>
<code>curl <?php echo site_url('view/raw/[pasteid]'); ?></code>
<p class="explain">Display paste.</p>
<h3>Get paste ;-)</h3>
<code>curl <?php echo site_url('view/raw/[pasteid]'); ?></code>
<p class="explain">Display paste.</p>
</div>
</div> </div>
<?php $this->load->view("defaults/footer");?> <?php $this->load->view("defaults/footer");?>