Skip to content

Instantly share code, notes, and snippets.

@8
Last active August 29, 2015 14:09
Show Gist options
  • Save 8/da28d3c2dd1dac5eb21f to your computer and use it in GitHub Desktop.
Save 8/da28d3c2dd1dac5eb21f to your computer and use it in GitHub Desktop.
script to get the indiegogo.com campaign status
#/bin/bash
# the url of the campaign
CAMPAIGN="raspicommplus-all-in-one-raspberry-pi-extension"
# use the first argument as the campaign name
if [[ "$1" != "" ]]; then
CAMPAIGN="$1"
fi
URL="https://www.indiegogo.com/projects/$CAMPAIGN"
# look for the utag_data
DATA=`curl -s ${URL} | grep utag_data`
function get_value() {
local param="s/.*$1\":([^,]*),.*/\1/g"
local value=`echo ${DATA} | sed -r "$param"`
echo $1: $value
}
get_value "campaign_raised_amount"
get_value "campaign_goal_amount"
get_value "campaign_funders"
get_value "campaign_percent_of_goal"
get_value "campaign_days_left"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment