Created
March 9, 2017 22:17
-
-
Save dfairaizl/d4be33e2e0241ffdbab791d7296882f3 to your computer and use it in GitHub Desktop.
This file contains 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/bash | |
# This is how to sign a Cloudinary API request from bash | |
URL="https://api.cloudinary.com/v1_1/thedailybeast/image/upload" | |
API_KEY=574791189343157 | |
API_SECRET=abcd | |
DATE=$(date +%s) | |
SHA=$(echo -n "overwrite=false×tamp=${DATE}&unique_filename=false&upload_preset=zcjiokbi&use_filename=true${API_SECRET}" | shasum -a 1 | awk '{print $1}') | |
FILE="http://cdn.thedailybeast.com/content/dam/dailybeast/2017/02/23/170223-Vox-homeopathic-drug-tease.jpg" | |
http post $URL \ | |
api_key==$API_KEY \ | |
file==$FILE \ | |
overwrite==false \ | |
signature==$SHA \ | |
timestamp==$DATE \ | |
unique_filename==false \ | |
upload_preset==zcjiokbi \ | |
use_filename==true \ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment