-
-
Save johnelliott/1a4a0879813991167bc994fa4a8189e5 to your computer and use it in GitHub Desktop.
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/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