Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Created a nicer readme file. Issue #2 #9

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 57 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,57 @@
# 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.

- **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.

Pasting is heavily rate limited.

---
`GET https://paste.rs/<id>`

Retrieve the paste with the given id as plain-text.

---

`GET https://paste.rs/<id>.<ext>`

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/<id>`

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 <id> using PowerShell:**

`Invoke-RestMethod -Uri "https://paste.rs/<id>" -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
}
```