Skip to content

Instantly share code, notes, and snippets.

@floshodan
Created April 5, 2019 22:33
Show Gist options
  • Save floshodan/3c3ff4232ccba8d709bb9c275abcb5d4 to your computer and use it in GitHub Desktop.
Save floshodan/3c3ff4232ccba8d709bb9c275abcb5d4 to your computer and use it in GitHub Desktop.
Pixhost Upload Shellscript using API
#/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