#!/bin/bash

#This script will pull and print usage data

public_key="PUBLIC_KEY_HERE"
private_key="PRIVATE_KEY_HERE"

verb="GET"
path="/api/v1/usage"
DATE=$(date -u +%a,\ %d\ %b\ %Y\ %H:%M:%S\ GMT)

str=$verb$path$DATE

str_base64=$(echo -n $str | openssl dgst -binary -sha1 -hmac $private_key | base64)

curl -H "Authorization:OWL ${public_key}:${str_base64}" -H "X-VISION-DATE:${DATE}" "https://api.darkowl.com$path"
