2011-05-30 09:03:04 +10:00
|
|
|
{% extends "base.html" %}
|
|
|
|
|
|
|
|
{% block headline %}
|
|
|
|
<h1>About dpaste.de</h1>
|
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
{% block content %}
|
|
|
|
<h2>API</h2>
|
|
|
|
|
|
|
|
<pre>#!/usr/bin/env python
|
2012-04-15 19:59:31 +10:00
|
|
|
|
2011-05-30 09:03:04 +10:00
|
|
|
import urllib
|
|
|
|
import urllib2
|
|
|
|
import sys
|
2012-04-15 19:59:31 +10:00
|
|
|
|
2011-05-30 09:03:04 +10:00
|
|
|
def paste_code():
|
|
|
|
request = urllib2.Request(
|
|
|
|
'http://dpaste.de/api/',
|
2013-03-06 22:18:38 +11:00
|
|
|
urllib.urlencode([('content', sys.stdin.read())]),
|
2011-05-30 09:03:04 +10:00
|
|
|
)
|
|
|
|
response = urllib2.urlopen(request)
|
2013-03-06 22:18:38 +11:00
|
|
|
# Strip surrounding quotes (NB: response has no trailing newline)
|
2011-05-30 09:03:04 +10:00
|
|
|
print response.read()[1:-1]
|
2012-04-15 19:59:31 +10:00
|
|
|
|
2011-05-30 09:03:04 +10:00
|
|
|
if __name__ == '__main__':
|
|
|
|
paste_code()</pre>
|
|
|
|
|
|
|
|
<p>Save this script in <code>/usr/local/bin/dpaste</code> and <code>chmod +x ..filepath</code>.</p>
|
|
|
|
<p>Usage: <code>cat foo.txt | dpaste</code></p>
|
2013-03-06 22:18:54 +11:00
|
|
|
|
|
|
|
<p>Or you could use <code>curl</code>:
|
|
|
|
<code>alias dpaste="curl -F 'content=<-' http://dpaste.de/api/</code></p>
|
|
|
|
|
2013-03-19 21:30:05 +11:00
|
|
|
<h2>Applications using the API:</h2>
|
|
|
|
|
|
|
|
<ul>
|
|
|
|
<li><a href="https://github.com/bartTC/dpasteGUI/wiki">dpasteGUI</a>, a OS X interface</li>
|
|
|
|
<li><a href="https://github.com/bartTC/SubDpaste">a dpaste Sublime 2 plugin</a></li>
|
|
|
|
<li><a href="http://marmalade-repo.org/packages/dpaste_de">Marmalade</a>, a Emacs plugin</li>
|
|
|
|
</ul>
|
2011-05-30 09:03:04 +10:00
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
|
|
|
|
{% block sidebar %}
|
|
|
|
<h2>Imprint</h2>
|
2012-04-15 19:59:31 +10:00
|
|
|
|
2011-05-30 09:03:04 +10:00
|
|
|
<p>
|
|
|
|
<strong>Address</strong>
|
|
|
|
</p>
|
|
|
|
<p>
|
|
|
|
Martin Mahner<br/>
|
|
|
|
Lauterbacher Str. 4<br/>
|
|
|
|
DE-18581 Putbus<br/>
|
|
|
|
Germany
|
|
|
|
</p>
|
2012-04-15 19:59:31 +10:00
|
|
|
|
2011-05-30 09:03:04 +10:00
|
|
|
<p>
|
|
|
|
<strong>Jabber/E-Mail:</strong>
|
|
|
|
</p>
|
2012-04-15 19:59:31 +10:00
|
|
|
|
2011-05-30 09:03:04 +10:00
|
|
|
<p>
|
|
|
|
<a href="mailto:martin@mahner.org">martin@mahner.org</a>
|
|
|
|
</p>
|
2012-04-15 19:59:31 +10:00
|
|
|
|
2011-05-30 09:03:04 +10:00
|
|
|
<p>
|
|
|
|
<strong>Phone:</strong>
|
|
|
|
</p>
|
2012-04-15 19:59:31 +10:00
|
|
|
|
2011-05-30 09:03:04 +10:00
|
|
|
<p>
|
2012-04-15 19:59:31 +10:00
|
|
|
+49 38301 890(770+8)<sup>1</sup><br/><br/>
|
2011-05-30 09:03:04 +10:00
|
|
|
<small style="font-size:0.9em;"><sup>1</sup> Yes, that's math!</small>
|
|
|
|
</p>
|
|
|
|
{% endblock %}
|