variable noch ausgetauscht
This commit is contained in:
parent
d273eaa17a
commit
e644d5799d
|
|
@ -25,8 +25,8 @@ for line in $(cat "$file_path"); do
|
|||
## WMDE-Survey Respondents ("Adressbuch")
|
||||
rm -f /tmp/survey-$line-adress.json
|
||||
echo "[]" > /tmp/survey-$line-adress.json
|
||||
for POLL in $(curl -s -X GET -H "Authorization: Bearer 643M34DK" https://app.lamapoll.de/api/v2/polls?limit=1000 | jq -r '.[] | .id'); do
|
||||
curl -s -X GET -H "Authorization: Bearer 643M34DK" https://app.lamapoll.de/api/v2/polls/${POLL}/respondents -s | jq -r '.' > /tmp/survey-$line-adress-$POLL.json
|
||||
for POLL in $(curl -s -X GET -H "Authorization: Bearer $line" https://app.lamapoll.de/api/v2/polls?limit=1000 | jq -r '.[] | .id'); do
|
||||
curl -s -X GET -H "Authorization: Bearer $line" https://app.lamapoll.de/api/v2/polls/${POLL}/respondents -s | jq -r '.' > /tmp/survey-$line-adress-$POLL.json
|
||||
jq '. += (inputs)' /tmp/survey-$line-adress.json /tmp/survey-$line-adress-$POLL.json > temp.json && mv temp.json /tmp/survey-$line-adress.json && rm /tmp/survey-$line-adress-$POLL.json ; done
|
||||
|
||||
# filter surveys for values and extract id, pollId, name, email
|
||||
|
|
@ -47,8 +47,8 @@ for line in $(cat "$file_path"); do
|
|||
## WMDE-Survey Results ("Freitextsuche")
|
||||
rm -f /tmp/survey-$line-freetext.json
|
||||
echo "[]" > /tmp/survey-$line-freetext.json
|
||||
for POLL in $(curl -s -X GET -H "Authorization: Bearer 643M34DK" https://app.lamapoll.de/api/v2/polls?limit=1000 | jq -r '.[] | .id'); do
|
||||
curl -s -X GET -H "Authorization: Bearer 643M34DK" https://app.lamapoll.de/api/v2/polls/${POLL}/results -s | jq --arg POLL "${POLL}" -r '. | .pollId = $POLL' > /tmp/survey-$line-freetext-$POLL.json
|
||||
for POLL in $(curl -s -X GET -H "Authorization: Bearer $line" https://app.lamapoll.de/api/v2/polls?limit=1000 | jq -r '.[] | .id'); do
|
||||
curl -s -X GET -H "Authorization: Bearer $line" https://app.lamapoll.de/api/v2/polls/${POLL}/results -s | jq --arg POLL "${POLL}" -r '. | .pollId = $POLL' > /tmp/survey-$line-freetext-$POLL.json
|
||||
jq '. += [(inputs)]' /tmp/survey-$line-freetext.json /tmp/survey-$line-freetext-$POLL.json > temp.json && mv temp.json /tmp/survey-$line-freetext.json && rm /tmp/survey-$line-freetext-$POLL.json ; done
|
||||
|
||||
cat /tmp/survey-$line-freetext.json | tr -cd '\11\12\40-\176' > /tmp/survey-$line-freetext-removed.json
|
||||
|
|
|
|||
Loading…
Reference in New Issue