mirror of
https://github.com/HaschekSolutions/pictshare.git
synced 2025-11-11 18:56:21 +00:00
Add commandline alias examples
This commit is contained in:
40
rtfm/API.md
40
rtfm/API.md
@@ -37,6 +37,25 @@ Answer from the server:
|
||||
{"status":"ok","hash":"y1b6hr.jpg","url":"https://pictshare.net/y1b6hr.jpg"}
|
||||
```
|
||||
|
||||
2. Uploading from the commandline using alias, requires `jq` package for json response decoding
|
||||
|
||||
Put this in your `.bashrc` or `.zshrc`:
|
||||
```
|
||||
pict () {
|
||||
curl -s -F "file=@${1:--}" https://pictshare.net/api/upload.php | jq -r '.url';
|
||||
}
|
||||
```
|
||||
|
||||
Usage:
|
||||
```
|
||||
$ cat path/to/image.jpg | pict
|
||||
```
|
||||
|
||||
Repsonse:
|
||||
```
|
||||
https://pictshare.net/y1b6hr.jpg
|
||||
```
|
||||
|
||||
# geturl.php
|
||||
|
||||
- URL https://pictshare.net/api/geturl.php
|
||||
@@ -100,6 +119,25 @@ Answer from the server:
|
||||
}
|
||||
```
|
||||
|
||||
3. Uploading from the commandline using alias, requires `jq` package for json response decoding
|
||||
|
||||
Put this in your `.bashrc` or `.zshrc`:
|
||||
```
|
||||
pictget () {
|
||||
curl -s "hhttps://pictshare.net/api/geturl.php?url=$1" | jq -r '.url';
|
||||
}
|
||||
```
|
||||
|
||||
Usage:
|
||||
```
|
||||
$ pictget https://i.imgur.com/qQstLQt.mp4
|
||||
```
|
||||
|
||||
Repsonse:
|
||||
```
|
||||
https://pictshare.net/u0ni1m.mp4
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
# pasetebin.php
|
||||
@@ -165,4 +203,4 @@ Upload local image "test.jpg" to pictshare
|
||||
"delete_code": "z0e1mdo8szxnauspxp2f080e4wd4ycf2",
|
||||
"delete_url": "https://dev.pictshare.net/delete_z0e1mdo8szxnauspxp2f080e4wd4ycf2/lpl119.jpg"
|
||||
}
|
||||
```
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user