diff --git a/dpaste/templates/dpaste/about.html b/dpaste/templates/dpaste/about.html index 74b2eb6..dd6551b 100644 --- a/dpaste/templates/dpaste/about.html +++ b/dpaste/templates/dpaste/about.html @@ -25,7 +25,7 @@
  1. #!/usr/bin/env python
  2.  
  3. from urllib import urlencode
  4. from urllib2 import Request, urlopen
  5. from sys import stdin
  6.  
  7. def paste_code():
  8.     request = Request('https://dpaste.de/api/', urlencode({
  9.         'content': stdin.read(),
  10.         'lexer': 'python',
  11.         'format': 'url',
  12.     }))
  13.     print urlopen(request).read()
  14.  
  15. if __name__ == '__main__':
  16.     paste_code()

-

Save this script in /usr/local/bin/dpaste and chmod +x ..filepath.

+

Save this script in /usr/local/bin/dpaste and give it the executable bit: chmod +x /usr/local/bin/dpaste.

Usage: cat foo.txt | dpaste

An alternative would be to just use curl: