BoG/scripts/shell/helloasso.sh

26 lines
767 B
Bash
Executable File

#!/bin/bash
ids="axiom-team:tYrjD6rrfStJXBqHhzNET"
ha="https://api.helloasso.com/v3"
adherents() {
url="$ha/campaigns/000001053192/actions.json?type"
curl -m 5 --user $ids -s $url | jq -r '.resources[] | .date + " , " + .first_name + " " + .last_name + " - " + .email' | sed 's/T.*,//'
}
adherentsSoft() {
url="$ha/campaigns/000001053192/actions.json?type"
curl -m 5 --user $ids -s $url | jq -r '.resources[] | .date + " , " + .first_name + " " + .last_name' | sed 's/T.*,//'
}
cagnotte() {
url="$ha/campaigns/000001053192.json"
curl -m 5 --user $ids -s $url | jq -r '.name, {"Donnateurs": .supporters},{"Fonds":.funding},.url' | grep -vE '{|}'
}
[[ $(type $@ | grep "est une fonction") ]] && $@ || echo "Veuillez préciser votre commande"
exit 0