emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/webpaste 984f838 068/298: Added dpaste.de as provider


From: ELPA Syncer
Subject: [nongnu] elpa/webpaste 984f838 068/298: Added dpaste.de as provider
Date: Thu, 9 Dec 2021 18:59:46 -0500 (EST)

branch: elpa/webpaste
commit 984f8386009e446ae84a0b233dacfea6ff592066
Author: Elis Axelsson <elis.axelsson@gmail.com>
Commit: Elis Axelsson <elis.axelsson@gmail.com>

    Added dpaste.de as provider
---
 README.org  |  4 ++--
 webpaste.el | 16 +++++++++++++++-
 2 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/README.org b/README.org
index 99c64a9..c991487 100644
--- a/README.org
+++ b/README.org
@@ -19,10 +19,10 @@ easiest way to install and configure packages.
            ("C-c C-p C-r" . webpaste-paste-region)))
 #+END_SRC
 
-** TODO Providers to implement [3/6]
+** TODO Providers to implement [4/6]
  - [X] ix.io
  - [X] dpaste.com
  - [X] sprunge.us
- - [ ] dpaste.de
+ - [X] dpaste.de
  - [ ] paste.pound-python.org
  - [ ] paste.debian.net
diff --git a/webpaste.el b/webpaste.el
index 6d359ef..f0d3b12 100644
--- a/webpaste.el
+++ b/webpaste.el
@@ -140,7 +140,21 @@ Usage:
       :success
       (cl-function (lambda (&key response &allow-other-keys)
                      (webpaste-return-url
-                      (request-response-header response "Location")))))))
+                      (request-response-header response "Location"))))))
+
+    ("dpaste.de" .
+     (webpaste-provider
+      :domain "https://dpaste.de/api/";
+      :parser 'buffer-string
+      :post-data '(("lexer" . "text")
+                   ("format" . "url")
+                   ("expires" . 86400))
+      :post-field "content"
+      :success
+      (cl-function (lambda (&key data &allow-other-keys)
+                     (when data
+                       (webpaste-return-url
+                        (replace-regexp-in-string "\n$" "" data))))))))
 
   "Define all webpaste.el providers.
 Consists of provider name and lambda function to do the actuall call to the



reply via email to

[Prev in Thread] Current Thread [Next in Thread]