Created
November 16, 2022 09:22
-
-
Save tokland/ae3150365abaee175f34cae1095e95b0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e -u -o pipefail | |
run() { | |
for version in "$@"; do | |
local url="https://play.dhis2.org/$version/api" | |
echo "# $version" | |
curl -sS -u 'admin:district' -L "$url/events.json?event=QsAhMiZtnl2&fields=*" | jq >events.json | |
curl -H "Content-Type: application/json" -sS -u 'admin:district' "$url/events" \ | |
-d"@events.json" -X POST | jq '.response.importSummaries[] | {stats: .importCount, description: .description}' -c | |
done | |
} | |
run "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment