rushlink/assets/templates/html/index.html.tmpl

45 lines
1.7 KiB
Cheetah
Raw Normal View History

2019-12-16 11:51:41 +01:00
{{define "head-append"}}
<script type="text/javascript" src="/js/dragdrop.js" defer></script>
{{end}}
2019-09-15 19:51:54 +02:00
{{define "body"}}
2019-12-16 11:51:41 +01:00
<div style="visibility:hidden; opacity:0" id="dropZone">File incoming! :D</div>
2019-12-16 05:23:36 +01:00
<h1>#RU paste-dump</h1>
2019-08-25 21:33:56 +02:00
2019-12-16 05:23:36 +01:00
Based on https://0x0.st/, this site allows you to easily upload files and shorten URLs using
2019-08-25 21:33:56 +02:00
the command line.
2019-12-16 05:23:36 +01:00
<h2>Web-API</h2>
<section>
2019-12-16 11:51:41 +01:00
<form id="fileUploadForm" action="/" method="post" enctype="multipart/form-data">
2019-12-16 05:23:36 +01:00
<label class="formLabel" for="fileUploadField">Upload a file:</label>
2019-12-16 11:51:41 +01:00
<input id="fileUploadField" class="formMain" name="file" type="file" />
<input id="fileUploadField" class="formSubmit" type="submit" value="upload!" />
2019-12-16 05:23:36 +01:00
</form>
</section>
<section>
2019-12-16 11:51:41 +01:00
<form id="shortenURLForm" action="/" method="post" enctype="multipart/form-data">
2019-12-16 05:23:36 +01:00
<label class="formLabel" for="shortenURLField">Upload a URL:</label>
2019-12-16 11:51:41 +01:00
<input id="shortenURLField" class="formMain" name="shorten" type="url" />
<input id="shortenURLSubmit" class="formSubmit" type="submit" value="shorten!" />
2019-12-16 05:23:36 +01:00
</form>
</section>
2019-08-25 21:33:56 +02:00
2019-12-16 05:23:36 +01:00
<h2>Command line API</h2>
<pre>
# Upload a file
2019-12-17 11:13:32 +01:00
curl -F'file=@yourfile.png' <a href="{{.RootURL}}">{{.RootURL}}</a>
2019-08-25 21:33:56 +02:00
# Shorten a URL
2019-12-17 11:13:32 +01:00
curl -F'shorten=http://example.com/some/long/url' <a href="{{.RootURL}}">{{.RootURL}}</a>
# The first line of the result will contain the shortened URL.
#
# In the other lines, you will find other information, including
# information on how to delete the shortened object.
# To upload a file and only extract the shortened URL (i.e. throw away the rest)
2019-12-17 11:13:32 +01:00
curl -F'file=@yourfile.png' <a href="{{.RootURL}}">{{.RootURL}}</a> | head -n 1
2019-09-15 19:51:54 +02:00
</pre>
{{end}}