Skip to content

Instantly share code, notes, and snippets.

@fsaintjacques
Created June 14, 2015 19:23
Show Gist options
  • Save fsaintjacques/9dba23d7422f6dc5e604 to your computer and use it in GitHub Desktop.
Save fsaintjacques/9dba23d7422f6dc5e604 to your computer and use it in GitHub Desktop.
#! /usr/bin/env bash
function fetch_report() {
local date_start=$1
local date_end=$2
curl --silent \
"http://ville.montreal.qc.ca/vuesurlescontrats/api/releases.json?date_gt=${date_start}&date_lt=${date_end}&order_by=date&order_dir=desc&format=json&limit=10000&offset=0" | \
jq -c '.releases[]'
}
prev=2012-01-01
for d in 2012-06-01 2013-01-01 2013-06-01 2014-01-01 2014-06-01 2015-01-01; do
fetch_report $prev $d
prev=$d
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment