From cd82141f39076596deea52dd65c56e517ef9652e Mon Sep 17 00:00:00 2001 From: WatermelonKnight <50963562+BasDeGamer@users.noreply.github.com> Date: Mon, 8 Aug 2022 15:16:51 +0200 Subject: [PATCH 01/10] Readme test --- README.md | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 55 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 805e6b9..7d5b642 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,55 @@ -# pastebin-telegram -Thanks to https://paste.rs/ and (Sergio Benitez)[] + BROWSER USAGE + + https://paste.rs/web + + API USAGE + + POST https://paste.rs/ + + Send the raw data along. Will respond with a link to the paste. + + If the response code is 201 (CREATED), then the entire paste was + uploaded. If the response is 206 (PARTIAL), then the paste exceeded + the server's maximum upload size, and only part of the paste was + uploaded. If the response code is anything else, an error has + occurred. Pasting is heavily rate limited. + + GET https://paste.rs/ + + Retrieve the paste with the given id as plain-text. + + GET https://paste.rs/. + + Retrieve the paste with the given id. If ext is a known code file + extension, the paste is syntax highlighted and returned as HTML. If + ext is a known file extension, the paste is returned with the + extension's corresponding Content-Type. Otherwise, the paste is + returned as plain text. + + DELETE https://paste.rs/ + + Delete the paste with the given id. + + EXAMPLES + + Paste a file named 'file.txt' using PowerShell: + + Invoke-RestMethod -Uri "https://paste.rs" -Method Post -InFile .\file.txt + + Paste from stdin using PowerShell: + + echo "Hi!" | Invoke-RestMethod -Uri "https://paste.rs" -Method Post + + Delete an existing paste with id using PowerShell: + + Invoke-RestMethod -Uri "https://paste.rs/" -Method Delete + + A PowerShell function that can be used for quick pasting from the + command line. The command takes a filename or reads from stdin if none was + supplied and outputs the URL of the paste to stdout: `Paste file.txt` or + `echo "hi" | Paste`. + + function Paste([string]$file) { + $Data = if ($file) {Get-Content $file} else {$input} + Invoke-RestMethod -Uri "https://paste.rs" -Method Post -Body $Data + } \ No newline at end of file From 8ee5416c188f78ad20f1d900f5084bb974f84643 Mon Sep 17 00:00:00 2001 From: WatermelonKnight <50963562+BasDeGamer@users.noreply.github.com> Date: Mon, 8 Aug 2022 15:21:28 +0200 Subject: [PATCH 02/10] test --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7d5b642..b2374b4 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,10 @@ https://paste.rs/web API USAGE - + + ~~~ POST https://paste.rs/ + ~~~ Send the raw data along. Will respond with a link to the paste. From 97a51333f271a50c3b9dcb8b07ddf959feb88faf Mon Sep 17 00:00:00 2001 From: WatermelonKnight <50963562+BasDeGamer@users.noreply.github.com> Date: Mon, 8 Aug 2022 15:22:04 +0200 Subject: [PATCH 03/10] test --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b2374b4..87e44ea 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,9 @@ API USAGE - ~~~ + ´´´ POST https://paste.rs/ - ~~~ + ´´´ Send the raw data along. Will respond with a link to the paste. From e878ea40523155376eb9b6aa5990e50ac609f3b2 Mon Sep 17 00:00:00 2001 From: WatermelonKnight <50963562+BasDeGamer@users.noreply.github.com> Date: Mon, 8 Aug 2022 15:24:08 +0200 Subject: [PATCH 04/10] highlights? --- README.md | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 87e44ea..427f086 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,10 @@ - BROWSER USAGE + ==BROWSER USAGE== https://paste.rs/web - API USAGE + ==API USAGE== - ´´´ POST https://paste.rs/ - ´´´ Send the raw data along. Will respond with a link to the paste. @@ -32,7 +30,7 @@ Delete the paste with the given id. - EXAMPLES + ==EXAMPLES== Paste a file named 'file.txt' using PowerShell: From daced21fb377a7d26f37d5649c56a74ddabec063 Mon Sep 17 00:00:00 2001 From: WatermelonKnight <50963562+BasDeGamer@users.noreply.github.com> Date: Mon, 8 Aug 2022 15:49:43 +0200 Subject: [PATCH 05/10] Definitive --- README.md | 70 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 36 insertions(+), 34 deletions(-) diff --git a/README.md b/README.md index 427f086..1d76e37 100644 --- a/README.md +++ b/README.md @@ -1,55 +1,57 @@ - ==BROWSER USAGE== +###BROWSER USAGE - https://paste.rs/web +https://paste.rs/web - ==API USAGE== - - POST https://paste.rs/ +###API USAGE +`POST https://paste.rs/` - Send the raw data along. Will respond with a link to the paste. +Send the raw data along. Will respond with a link to the paste. - If the response code is 201 (CREATED), then the entire paste was - uploaded. If the response is 206 (PARTIAL), then the paste exceeded - the server's maximum upload size, and only part of the paste was - uploaded. If the response code is anything else, an error has - occurred. Pasting is heavily rate limited. +- **Response code 201 (Created)** +The entire paste was uploaded. +- **Response code 206 (Partial)** +The paste exceeded the maximum upload size, only part of the paste was uploaded. +- **Other response codes** +An error occurred. - GET https://paste.rs/ +Pasting is heavily rate limited. - Retrieve the paste with the given id as plain-text. +--- +`GET https://paste.rs/` - GET https://paste.rs/. +Retrieve the paste with the given id as plain-text. - Retrieve the paste with the given id. If ext is a known code file - extension, the paste is syntax highlighted and returned as HTML. If - ext is a known file extension, the paste is returned with the - extension's corresponding Content-Type. Otherwise, the paste is - returned as plain text. +--- - DELETE https://paste.rs/ +`GET https://paste.rs/.` - Delete the paste with the given id. +Retrieve the paste with the given id. If ext is a known code file extension, the paste is syntax highlighted and returned as HTML. If ext is a known file extension, the paste is returned with the extension's corresponding Content-Type. Otherwise, the paste is returned as plain text. - ==EXAMPLES== +--- - Paste a file named 'file.txt' using PowerShell: +`DELETE https://paste.rs/` - Invoke-RestMethod -Uri "https://paste.rs" -Method Post -InFile .\file.txt +Delete the paste with the given id. - Paste from stdin using PowerShell: +###Examples - echo "Hi!" | Invoke-RestMethod -Uri "https://paste.rs" -Method Post +- **Paste a file named 'file.txt' using PowerShell:** - Delete an existing paste with id using PowerShell: +`Invoke-RestMethod -Uri "https://paste.rs" -Method Post -InFile .\file.txt` - Invoke-RestMethod -Uri "https://paste.rs/" -Method Delete +- **Paste from stdin using PowerShell:** - A PowerShell function that can be used for quick pasting from the - command line. The command takes a filename or reads from stdin if none was - supplied and outputs the URL of the paste to stdout: `Paste file.txt` or - `echo "hi" | Paste`. +`echo "Hi!" | Invoke-RestMethod -Uri "https://paste.rs" -Method Post` - function Paste([string]$file) { +- **Delete an existing paste with id using PowerShell:** + +`Invoke-RestMethod -Uri "https://paste.rs/" -Method Delete` + +- **A PowerShell function that can be used for quick pasting from the command line. The command takes a filename or reads from stdin if none was supplied and outputs the URL of the paste to stdout: 'Paste file.txt' or 'echo hi" | Paste'.** + +``` +function Paste([string]$file) { $Data = if ($file) {Get-Content $file} else {$input} Invoke-RestMethod -Uri "https://paste.rs" -Method Post -Body $Data - } \ No newline at end of file + } +``` From a7319083e20c70ac445377590648c1331bfdecda Mon Sep 17 00:00:00 2001 From: WatermelonKnight <50963562+BasDeGamer@users.noreply.github.com> Date: Mon, 8 Aug 2022 15:50:41 +0200 Subject: [PATCH 06/10] fix? --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 1d76e37..ee9c021 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ -###BROWSER USAGE +#BROWSER USAGE https://paste.rs/web -###API USAGE +#API USAGE `POST https://paste.rs/` Send the raw data along. Will respond with a link to the paste. @@ -33,7 +33,7 @@ Retrieve the paste with the given id. If ext is a known code file extension, the Delete the paste with the given id. -###Examples +#Examples - **Paste a file named 'file.txt' using PowerShell:** @@ -54,4 +54,4 @@ function Paste([string]$file) { $Data = if ($file) {Get-Content $file} else {$input} Invoke-RestMethod -Uri "https://paste.rs" -Method Post -Body $Data } -``` +``` \ No newline at end of file From d2fe0c05e94cd1e489517152e9e3c972d979a97b Mon Sep 17 00:00:00 2001 From: WatermelonKnight <50963562+BasDeGamer@users.noreply.github.com> Date: Mon, 8 Aug 2022 15:51:26 +0200 Subject: [PATCH 07/10] fix 2? --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index ee9c021..d8759e1 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ -#BROWSER USAGE +#BROWSER USAGE# https://paste.rs/web -#API USAGE +#API USAGE# `POST https://paste.rs/` Send the raw data along. Will respond with a link to the paste. @@ -33,7 +33,7 @@ Retrieve the paste with the given id. If ext is a known code file extension, the Delete the paste with the given id. -#Examples +#Examples# - **Paste a file named 'file.txt' using PowerShell:** From f3a73433c6c2009887ba1156382d88cace2cc43e Mon Sep 17 00:00:00 2001 From: WatermelonKnight <50963562+BasDeGamer@users.noreply.github.com> Date: Mon, 8 Aug 2022 15:51:57 +0200 Subject: [PATCH 08/10] fix 3 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d8759e1..6c5440b 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ https://paste.rs/web -#API USAGE# +###API USAGE### `POST https://paste.rs/` Send the raw data along. Will respond with a link to the paste. From cc64d460cb7638a34d727eb0dd407ffe3b5cb6ab Mon Sep 17 00:00:00 2001 From: WatermelonKnight <50963562+BasDeGamer@users.noreply.github.com> Date: Mon, 8 Aug 2022 15:52:49 +0200 Subject: [PATCH 09/10] definitive fix --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 6c5440b..e0e921d 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ -#BROWSER USAGE# +### BROWSER USAGE https://paste.rs/web -###API USAGE### +### API USAGE `POST https://paste.rs/` Send the raw data along. Will respond with a link to the paste. @@ -33,7 +33,7 @@ Retrieve the paste with the given id. If ext is a known code file extension, the Delete the paste with the given id. -#Examples# +### Examples - **Paste a file named 'file.txt' using PowerShell:** From 85a3a5cbe273d734f3159e021a61dcb83332a970 Mon Sep 17 00:00:00 2001 From: WatermelonKnight <50963562+BasDeGamer@users.noreply.github.com> Date: Mon, 8 Aug 2022 15:54:06 +0200 Subject: [PATCH 10/10] ":" --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e0e921d..761ba4e 100644 --- a/README.md +++ b/README.md @@ -7,11 +7,11 @@ https://paste.rs/web Send the raw data along. Will respond with a link to the paste. -- **Response code 201 (Created)** +- **Response code 201 (Created):** The entire paste was uploaded. -- **Response code 206 (Partial)** +- **Response code 206 (Partial):** The paste exceeded the maximum upload size, only part of the paste was uploaded. -- **Other response codes** +- **Other response codes:** An error occurred. Pasting is heavily rate limited.