Skip to content

Instantly share code, notes, and snippets.

@spacetrack
Last active January 25, 2016 15:22
Show Gist options
  • Save spacetrack/006c86e6517f63f5bc42 to your computer and use it in GitHub Desktop.
Save spacetrack/006c86e6517f63f5bc42 to your computer and use it in GitHub Desktop.
#!/bin/bash
echo $#
this_date=`date +"%Y-%m-%d"`
this_time=`date +"%H:%M:%S"`
if [ $# -eq 1 ]
then
this_date=`date +"%Y-%m-%d"`
this_time=${1}
fi
if [ $# -eq 2 ]
then
this_date="${1}"
this_time="${2}"
fi
# from your profile page https://coffeestats.org/profile/ get the URL of the "on-the-run"-button
# ... there you'll find your user name and your token:
# https://coffeestats.org/ontherun/<user>/<token>/
coffee_date="${this_date} ${this_time}"
coffee_user="...user..."
coffee_token="...token..."
echo "coffee at ${coffee_date}"
curl -f -s -S -L -X POST -d "u=${coffee_user}&t=${coffee_token}&beverage=coffee&time=${coffee_date}" https://coffeestats.org/api/v1/add-drink
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment