#!/bin/bash # Configuration PARTNER=[PARTNER] COOKIE_JAR="cookies.txt" # # Check needed programs # type jq >/dev/null 2>&1 if [ $? -ne 0 ] ; then echo >&2 "This script requires 'jq'. Install it before proceeding." exit 1 fi type curl >/dev/null 2>&1 if [ $? -ne 0 ] ; then echo >&2 "This script requires 'curl'. Install it before proceeding." exit 1 fi # # URL encoding # See: https://stackoverflow.com/questions/296536/how-to-urlencode-data-for-curl-command # function rawurlencode { local string="${1}" local strlen=${#string} local encoded="" local pos c o for (( pos=0 ; pos