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

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

[nongnu] elpa/webpaste 29d10d7 151/298: Added paste.pound-python.org as


From: ELPA Syncer
Subject: [nongnu] elpa/webpaste 29d10d7 151/298: Added paste.pound-python.org as provider
Date: Thu, 9 Dec 2021 19:00:03 -0500 (EST)

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

    Added paste.pound-python.org as provider
---
 README.org  |  4 ++--
 webpaste.el | 19 ++++++++++++++++++-
 2 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/README.org b/README.org
index 04ea75a..95a1baf 100644
--- a/README.org
+++ b/README.org
@@ -82,14 +82,14 @@ Example:
 Can also be put in the =:config= section of =use-package= the same way as the
 provider definitions above.
 
-** TODO Providers to implement [6/10]
+** TODO Providers to implement [7/10]
  - [X] ptpb.pw
  - [X] ix.io
  - [X] dpaste.com
  - [X] sprunge.us
  - [X] dpaste.de
  - [X] gist.github.com
- - [ ] paste.pound-python.org
+ - [X] paste.pound-python.org
  - [ ] paste.debian.net
  - [ ] bpaste.net
  - [ ] eval.in
diff --git a/webpaste.el b/webpaste.el
index f238db5..73c14e8 100644
--- a/webpaste.el
+++ b/webpaste.el
@@ -122,6 +122,14 @@ precalculated, and also available both for pre and post 
request access.")
   "Predefined success callback for providers returning a Location header.")
 
 
+(defvar webpaste/providers-success-response-url
+  (cl-function (lambda (&key response &allow-other-keys)
+                 (when response
+                   (webpaste-return-url
+                    (request-response-url response)))))
+  "Predefined success callback for providers that and up with an URL somehow.")
+
+
 (defvar webpaste/providers-success-returned-string
   (cl-function (lambda (&key data &allow-other-keys)
                  (when data
@@ -326,7 +334,16 @@ Optional params:
        :success-lambda (cl-function (lambda (&key data &allow-other-keys)
                                       (when data
                                         (webpaste-return-url
-                                         (cdr (assoc 'html_url 
(json-read-from-string data))))))))))
+                                         (cdr (assoc 'html_url 
(json-read-from-string data)))))))))
+
+    ("paste.pound-python.org"
+     ,(webpaste-provider
+       :uri "https://paste.pound-python.org/";
+       :post-data '(("webpage" . ""))
+       :post-field "code"
+       :post-lang-field-name "language"
+       :lang-overrides '((emacs-lisp-mode . "clojure"))
+       :success-lambda webpaste/providers-success-response-url)))
 
   "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]