Skip to content

Instantly share code, notes, and snippets.

@protosam
Last active January 11, 2016 07:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save protosam/8c5c2130b69ace4f646f to your computer and use it in GitHub Desktop.
Save protosam/8c5c2130b69ace4f646f to your computer and use it in GitHub Desktop.
#!/bin/bash
# Include ticktick (https://github.com/kristopolous/TickTick)
curl -s https://raw.githubusercontent.com/kristopolous/TickTick/master/ticktick.sh > /tmp/ticktick.sh
source /tmp/ticktick.sh
rm -rf /tmp/ticktick.sh
MAILAPI="key-06ha5mc4hlpsl8-rwj66a8ctn1omzko6"
# get the data
DATA=`curl -s https://api.mailgun.net/v2/domains --user "api:$MAILAPI"`
echo THE RAW DATA
echo $DATA
echo ===============
# Turn it into useable object, spit out one
tickParse "$DATA"
echo ``items[0].name``
echo ===============
# make that item a bash variable
THETHING=``items[0].name``
echo $THETHING
# leave something here to ensure EOF is safe. TickTick.sh does weird shit.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment