Created
April 5, 2019 22:33
-
-
Save floshodan/3c3ff4232ccba8d709bb9c275abcb5d4 to your computer and use it in GitHub Desktop.
Pixhost Upload Shellscript using API
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/bin/sh | |
image=$(find -name "*.jpg") | |
export image | |
varCurl=$(curl -b --include "https://api.pixhost.to/images" \ | |
-H 'Content-Type: multipart/form-data; charset=utf-8' \ | |
-H 'Accept: application/json' \ | |
-F "img=@$image" \ | |
-F 'content_type=1' \ | |
-F 'max_th_size=500' ) | |
var1=$(echo $varCurl | jq -r '.show_url') | |
var2=$(echo $varCurl | jq -r '.th_url') | |
echo [url=$var1][img]$var2[/img][/url] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment