From f9b08c50009485817e8b44300f79a92e37fe9f22 Mon Sep 17 00:00:00 2001 From: Nicholas Vinson Date: Sat, 24 Oct 2020 09:40:16 -0400 Subject: Add srpunge paste bin Service owner states in https://github.com/rupa/sprunge/issues/46 that the size limit for both ix.io and sprunge.us is "roughly a meg". As "meg" appears to mean 1 MiB, the size is set at 1 million bytes (1 MB). --- wgetpaste | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/wgetpaste b/wgetpaste index 96b1cb1..0f8219b 100755 --- a/wgetpaste +++ b/wgetpaste @@ -41,7 +41,7 @@ POST_generic() { } ### services -SERVICES="0x0 bpaste codepad dpaste gists ix_io snippets" +SERVICES="0x0 bpaste codepad dpaste gists ix_io snippets sprunge" # 0x0 ENGINE_0x0=0x0 URL_0x0="http://0x0.st" @@ -72,6 +72,10 @@ SIZE_ix_io="1000000 1%MB" ENGINE_snippets=snippets URL_snippets="https://gitlab.com/api/v4/snippets" ADDITIONAL_HEADERS_snippets=("Content-Type: application/json") +# sprunge +ENGINE_sprunge=sprunge +URL_sprunge="http://sprunge.us" +SIZE_sprunge="1000000 1%MB" # tinyurl ENGINE_tinyurl=tinyurl URL_tinyurl="http://tinyurl.com/ api-create.php" @@ -292,6 +296,20 @@ POST_snippets() { local description="${2}" content="${6}" echo "{\"title\": \"${description}\", \"content\": \"${content}\", \"description\": \"${description}\", \"file_name\": \"${description}\", \"visibility\": \"${VISIBILITY_snippets}\" }" } +# sprunge +escape_description_sprunge() { echo "$*"; } +escape_input_sprunge() { echo "$*"; } +POST_sprunge() { + local content="${6}" boundary="WGETPASTE-1sQZYb7qiSkT18ZwWPNg18gEmHRztv" + echo "--$boundary" + echo "Content-Disposition: form-data; name=\"sprunge\"" + echo "" + echo "${content}" + echo "--${boundary}--" + ADDITIONAL_HEADERS_sprunge=("Content-Type: multipart/form-data; boundary=${boundary}") +} +REGEX_RAW_sprunge='s|^http.*|\0|' +REGEX_URL_sprunge='s|^http.*|\0|p' ### errors die() { -- cgit v1.2.3